Welcome to TRS
Its not the engine size its the wiring and computer for the engine
Rangers used the 60-wire EEC-IV computer thru 1994, OBD1
1995 and up used the 104-wire EEC-V computers, OBD2
Mazda B4000 were the same
I thought Explorers were the same, 1995 and up were EEC-V?
4.0l OHV was used 1990 to 2000
The EEC-V computers needed a rear O2 sensor, after the Cats, to check if they are working, so you have to run Cats and they have to work, on the exhaust system, which some don't like on custom builds
So the added wiring is the reason you would look for a donor that uses EEC-IV wiring and harness, simpler swap wiring-wise
But EEC-V is certainly doable, but only to 1997, after that you have PATS(passive anti-theft) to deal with, and speedometer
issues
PATS started in 1998 in Explorers and 1999 in V6 Rangers
All lost speedometer cable hook up by 1998, even on transfer cases
It can all be overcome just more layers to the swap