Welcome to the Z.
The Cherokee tranny clocks the
transfer case lower than on the YJ, so to use it in the YJ you would need to redrill the holes at the back of the tranny to clock the
transfer case up and keep it from contacting the skidplate.
There is a difference in spline count on the tranny output shaft between those two trannies, so you'll either need the transfer case with the Cherokee tranny or swap the correct input shaft into your transfer case.
There is likely a difference in clutches, as well as flywheels and pilot bearings, unsure on those two.