You want to create a layer mask and paste an image into it
- copy the image you want in the mask
- create a new layer and put black over the whole thing
- add a layer mask and option click it to get into the mask edit mode
- cmd + optn + shft + v to paste the image into the mask
- cmd + i to invert it
- profit
Look here