It "could" work
Without any information as to what actual engine is in either car, I can at least tell you the OBD generation won't match, going backwards is a big no no for emissions if that's a thing wherever you are, and the ECUs are also not compatible due to the auto vs manual thing in addition to the mismatched OBD generation
Accounting for at least those things, it is possible to swap the engines, whether it is worth it or legal is a different question
Both are f series one is 94 the other is 97 both are Accord ex and 5th gen. I was planning on leaving the ECU on each car 8n the car same with the transmissions, and all that goes with them. One has 278000 the other 115000 and smog isn't an issue in my state az.