You can use the 1991 Long Block(block with heads attached)
You need to swap over the 1998 front engine cover and crank pulley(for crank sensor), the upper and lower intakes(for fuel and sensor systems), to the 1991 long block
Also swap over the Cam sensor and synchro to replace 1991 distributor
So quite a few parts
For a more direct swap you would need a 1998-2008 3.0l Ranger or B3000 engine, but would still need to change some sensors most likely
Beside the OBD and spark system differences the Fuel system changed in 1998 and up Rangers