z-idex у элемента задаётся только при наличии позиции relative; absolute; или fixed
<html>
<head>
<style type="text/css">
.img {
     height: 100px;
     width: 100px;
     margin: 7px;
     }
.div1{
     position: relative;
     z-index: 1;
     }
.div2{
     position: absolute;
     top: 20px;
     height: 100px;
     width: 100px;
     border: 1px solid white;
     z-index: 2;
     }
</style>
</head>
<body bgcolor="#000">
<div class="div1">
   <img class="img" src="/006.jpg" />
</div>
<div class="div2" onmouseover="this.style.cursor='pointer';" onclick="alert('onClickEvent');">
</div>
</body>
</html>