Gear damage

Hello everyone, I have a problem with my Subaru impreza Hawkeye GD/GG 2.0L R with 160ps EZ 2005. Yesterday the car has suffered an engine damage and now the first and second gears no longer go in. I can still push the gear selector to the left but to the front and rear blocks the gearbox. Now to my question: can you fix this? In the worst case I also have a gearbox from the same car but in the 125ps version. Can you install this without hesitation or is Is this not compatible? Does anyone have experience? Would I appreciate an answer and thank you for your help.