Select everything (CTRL+A)in the second (mask) JPG, copy, then open the second JPG, and, in the <b>Channels</b> palette make a new channel; paste into the new channel.
If you want transparency in the PNG...
First make sure that the background is a layer - ALT+DOUBLE CLICK on the Background...