Welcome to AF.
Sure it would fit, but several things would have to be installed/changed.
For the cost and head ache,
you would be better off replacing the head gasket or buying another car.
Though if the motors are from the same year & model(97 GA) it would be easier because they use simular sensors.
Most sensors are different between the two engines, some sensors use 1 wire on the twin cam, and the V6 would use a 2 wire for that same sensor.
IMO its a big PITA