If you want it to be dependable... you’re asking about the wrong transmission. The were adequate behind the 4 cyl and iffy behind the 6 cyl.
The M5ODR1 (5 speed manual just to be clear to the OP) wasn't that bad behind the V6's, probably the best trans put in a Ranger period really.
The "5 speed" automatic was pretty meh. Pretty computer driven to try to adapt a V8 to also.
The M5ODR2 5 speed manual out of an F-150 fits nice and is basically a scaled up version of the R1 they put in Ranger's. Ranger clutch hydraulics fit and work great (I have one in my truck) They all fit but 97-04 fit the best, the shifter is in a position more like the R1 in a Ranger. Ranger shift levers are easily adapted to the R2 shift stub too.
One potential snag if you are 2wd, gotta watch speedo outputs. F-150 went to an electronic speedometer sensor in the trans tailhousing in '97 and just ran off wheel speed sensors after that. Rangers monkeyed around doing different things like that but not necessarily the same year. I have gathered enough to know it is messy but since it doesn't really matter to me I haven't even tried to keep it straight.
If you are 4wd get the t-case that tickles your fancy and run it. Most in your era of truck opt for the BW4406 out of a 97-03 F-150 too, manual versions are available also.