Re: T5 trans from a 84 CJ in a 86 yj?
The '80+ wagoneers all have Chrysler automatics, all will fit the 258s, if you use a 258 flexplate appropriate for your starter. (the split is around '87, earier use the familiar Ford type, later use a gear reduction Mitsubishi).
Most Wagoneers and J series trucks use the 727, some had the 998. V8 pattern is exactly the same as the sixes. Both will fit the YJ, if the YJ t-case has the 23 spline, automatic type input gear. The Wagoneer t-case is usually a NP229. This unit has the drive on the drivers' side and is very HD compared to a NP231 or NP207. It should fit the YJ but it may need slight mods to work, like custom linkage, vacuum lines and a switch, etc. One advantage is it has yoke bolted to the rear output shaft, much stronger than the slip yoke in the 231. It also has a full time range for 4wd high, allowing use on the street in the rain. It locks in 4wd low.
The 727 will fit the 231/207 if you use the shift bracket for the 998, the proper 998 type input gear in the t-case, even the column shifter and kickdown linkage will fit perfectly. The flexplate is drilled for either a large or small converter, the small one is stock on 258s. The overall length is 1/4" shorter than the 998! Approx. 22.5" from bellhousing to extension housing! The stock YJ 998 automatic trans mount and bracket will bolt right onto the 727, and end up in the same spot on the skidplate. Factory automatic trans length driveshafts won't need changing, either. All in all, a perfect bolt in into a YJ 258 or AMC V8 swap. It won't work with the 4.0L, unless you install one of the aftermarket modified dampner/crank sensor kits, as there is no cut out for the sensor in the 727s.
The 727 will also fit the CJ and it's Dana 300 T-case, but the front driveshaft will interfere with the bumpout on the pass. side of the pan, unless you construct a 2 piece shaft or are running a fairly high lift. The Atlas T-case is approx. 1" wider, and this will allow it to fit fine.
Hope this helps, good luck!