umm... depends what the car was, SR5 coupes and sedans had the 4AFE, GTS coupes have the 4AGE.
No the Corolla transmission won't fit the 3SGTE, you need either 5spd transmission from a 5SFE Camry or Celica, or the 5spd from a 3SGE powered Celica.
I believe the one from a 5spd Solara will also fit, but don't quote me on it. Your best bet is the ones I gave you up top. If you're planning to run this transmission with the 3SGTE, I would suggest upgrading to a Heavy Duty clutch as you will fry the OEM clutch with the 3SGTE.