Though this is not what you are doing I wanted to add to the discussion.
I ran a complete EJ25D in my 91 Legacy on the original EJ22 ECU. Modifications to make it work -
Found a plug to seal the EGR port on the head (not actually necessary)
Swapped engine wire harness (used the EJ22 harness)
Swapped Throttle body (original Legacy had a reversed TPS voltage)
Put a washer under the cam sensor (sensor was too close to cam gear)
Your car will need to keep the exhaust manifold since the EJ22 has single port exhaust heads.
Is your Impreza automatic? If so the EJ22 will have a compatible EGR
It was fast as hell especially since I swapped a 4.44 final drive transmission.