An engine is an engine. If the displacement and other characteristics are compatible with the existing ECU, you could swap in the new engine if you were able to make the existing sensors work. A MAF sensor doesn't have any idea who manufactured the engine it's attached to... it just outputs a signal that correlates with the amount of air passing through the unit.
Otherwise, you could just swap the ECU along with the engine.
People make things like this work all the time.