Yes, the tranny will bolt right up, that will be no problem at all. If you are just wanting the tranny, and your current engine is fine, just say what the hell and do a tranny swap. Trust me, I have done two tranny swaps in 5th gens and 1 engine swap, and I can assure you that the tranny swap is less involved (if only slightly) and you're better off leaving the engine alone unless you have a good reason to pull it out.
I always tell everyone while you have the transmission out (and the exhaust downpipe off) do the following seals to save yourself an asshurt later:
Engine Rear Main Seal
Transmission Input Shaft Seal
Oil Pan Gasket
Distributor O Ring Seal (Be sure to use a utility knife to score the ear of the distributor and the ear on the head so you can get the distributor right back in the EXACT same spot)
Then if you haven't done your timing belt I'd consider doing that too if you want to be sure you aren't going to have to turn around and replace the engine anyway if it breaks.
If you do the timing belt job, here are the parts I always replace while doing it:
Valve Cover Gasket
Camshaft Seal
Crank Seal
Balance Shaft Seal
Tensioner Pulleys
TIming Belt
Balance Shaft Belt
Water Pump
Thermostat
Then if you want to be sure the cooling system will never leave you stranded you can replace the 3 heater hoses and 2 radiator hoses- I've had a heater hose that was only 11 years old burst on me, under normal driving, so I would take those seriously while you already have one off doing the transmission.
If you have any more questions let us know, but while doing major things its a good time to do the minor things as well.