OK... the 240sx tranny will work, kinda, you need the bell housing from the 300zx tranny, then it should line up right, the only thing is you might have to change the rear axel, depending on the ratio... dunno for sure, im more of a 240z-280zx man myself... (i think the 300zx's were a step in the wrong direction) but still, good luck...
http://www.automotiveforums.com/vbulletin/t521033.html
that might help some, pretty much the same topic from the other side.