Since the OP has a 4.2L (aka 258) the 904 (909 if it's lockup) from a 2.5L motor won't work. They have the same bell pattern as the 2.8 V6 used in Chevs and '84-86 XJs. The trans from a '71 or newer 232/258, 4.0L, 4.2L or AMC V8 (flexplate needs to be changed as the 6 is zero balanced)
Since the YJ has a driver's side front driveshaft, the simplest set up is a 998 from an AMC Eagle/YJ or 999 from an '80 to 83 full size Cherokee with 6 cyl.
The Grand Wagoneers and other FSJs '80 to '83 (J pickups '80 to '88) often have a 727 which will work, but it's a bit wider so using the tcase from an FSJ would be best. (NP208J is the simplest one, followed by NP219. NP229 and NP228 are vacuum shifted to 4x4 and lever shifted to low range)