2.9L came stock in Ranger/B II from 86 to 92, the later being the last year of 2.9 production.
Yes it will fit!
You will need the engine control module for it and the transmission you get.
You should check out this site before you consider swapping in a 2.9L:
The Ranger Station - Your Ultimate Ranger Resource
Go check out the tech library, register and visit the forum.
Some where they have an archive that dates back to 99 I think, any way look around there and read about the 2.0 (Lima) and the 2.9 (Cologne).
Next, not knowing anymore about the problem than the fact your 2.0 is puking some oil, but otherwise runs good.
I have to ask where the oil is coming from, front or back?
Replacing a seal or a gasket is way less money and a lot less complicated than swapping in a different engine.
I can tell you this about a 2.9, it is very common for them to have or develop cracked heads, there are a lot of them out there, but they are becoming tougher to find parts for, as they were only produced for 6 years. If you want to swap engines shop around and ask a lot of questions before you go buying another engine, or possibly another problem.
Honestly, I would fix the oil leak and keep the 2.0, it is economically a better choice. Aside from that, I would look for another 2.0 or a 2.3, that would be
a simple swap.
Do some investigating and figure out what you want to do, then let us know.