All you need to do to make it work, is change the upper intake, and fuel rail assembly/injectors from your old engine. No other changes needed. Have swapped several both ways, spent hours researching part numbers, factory information, etc. Congrats on finding a newer engine, the timing components should be the better, updated version. Its all actually easier than it sounds. If you need any more info, I'll be happy to expand on the subject.
Some 02's had different wiring, so double check your sensors, but the longblock (engine block, heads, lower intake, etc) are all the same on all years 4.0 SOHC. flex or non flex. The only noteable difference being the newer ones got an updated timing setup, and the first SOHC 4.0s had a freeze plug in the lower intake, where the knock sensor is now.
You will need new upper intake o-rings and Intake isolator bolt set to swap the upper intake/ Recommend to put new fuel injector o-rings as well, but I've been able to reuse them with careful prying to remove, and a light coat of engine oil on them to go back in.