The transmission may work for a while, but it wasn't made to handle that much power. It depends on how careful you are. No one can say how long it will last. And when it goes out (which it will) you will have to swap in a new one. Of course swapping in a sti trans would be the way to go. Your stock trans is not the way to go.
The engine should bolt right on, but that isn't the only thing you will have to worry about. You may need to change the clutch and flywheel since they changed from a push to a pull style clutch. You will need to install a wrx or sti crossmember so the downpipe will clear.
Plus you are going to have do a lot of wiring and get the 09 ecu, or go with a standalone system. Do you have the 09 sti engine already? Can you get the rest of the parts (ecu, wiring harness, trans, axles, crossmember, to go with it?)