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