When all gears except 4th don't work then the input shaft gear is stripped, and the counter shaft gear as well
4th doesn't use a "gear", its 1:1 ratio so input shaft is connected directly to output shaft, no ratio(gear) change is needed
Requires full rebuild to repair and quite a few of the more expensive parts
Not at all a common failure, but a known failure on any Manual trans
Gear in upper left is input shaft, lower left is counter shaft:
http://www.nationalnewstoday.com/wp-content/uploads/2013/02/leah-schoenfeld-10b.jpg
Stripped of course, other gears can be on good condition
The issue is that those metal bits were being ground off for a while before total failure, so all the bearings should be replaced, and some of the "good gears" may have some unseen wear, so need to look closely
Counter shaft is one piece so needs to be replaced
If the 1991 also had gear issues then same contamination may exist
T5 input shaft gear seen here, so manual trans issue but not common, just known:
https://www.stangnet.com/mustang-forums/attachments/image-jpeg.587378/
Are parts interchangeable?
most are, but simple enough to just look up input shaft replacement and see what years that part is compatible with, and counter shaft, counter shaft must match ratios of main gears of course
And look up full rebuild kit and see if it includes 1991 to 2004 model years
In my opinion looking for a used M5R1 would be best, needs to be from a 4.0l 4x4, 2001-2011 Ranger or B4000
Needs the OSS sensor so has to be 2001-2011