95-98 2.2's and 2.5l's are interchangable. You need the engine being swapped in to match the EGR status of the car. All 2.5's had EGR, only automatic trans 2.2's did.
96+ 2.2's had single port exhaust, so you need the Y-pipe to match.
Swapping a 95 auto 2.2l into a 96-98 2.5l outback with blown headgaskets is a very common bolt in plug in and go conversion. Blown headgaskets are a very common affliction of EJ25d's.
The intake manifold harnesses are the same. The ECU doesn't seem to care which engine it's running. It's MAF based so it just adjusts for the differing airflow.
If swapping into an auto trans car, use the flexplate that matches the transmission. 2.2l torque converters are smaller, so the flexplate has a deeper dish than the 2.5l one.
99 2.5l's were still DOHC ej25d's, but had the 8 bolt bellhousing. 4 bolt bellhousing motors will work but you will need to fix the missing lower starter bolt.