Can a Ford F150 with a 5.4 3V engine be replace with the Ford 4.2 engine?

Can a Ford F150 with a 5.4 3V engine be replace with the Ford 4.2 engine?

Not if you don't want to replace the PCM and wiring harness.

Yes

Hi so the real issue here is. Is it a ford engine or a Mazda engine.

Yes