Add position:relative;
in css of both blocks:
<div style="width: 300px; height: 90px; overflow: hide;">
<div style="position: relative; width:300px; height: 50px; z-index: 2; background-color: #ff0000;">
</div>
<div style="position: relative; width:300px; height: 50px; z-index: 1; background-color: #ff00ff; margin-top: -30px;">
</div>
</div>
http://jsfiddle.net/uu721kgc/