Get the jack out and raise one of the rear tires off the ground. Spin tire on full rotation, have the transfer case in neutral, and count the rotations of the drive shaft. This will get you close to what you have. you count. Like if the drive shaft rotates 3 and 1/2 turns then you have close to 3.55 gears, 4 and little bit more than 4.10 gears.
Disclaimer this should be done where the vehicle will not roll ( tires blocked) and while on the jack stay out from under vehicle.
A 89 yj with a 4.0 aw4 sye out of an 92xj. Now the hard part is done time to get it up in the air just a bit. Working on 8.8 with 3.73 and lsd for the rear. and new D30 hp with 3.73 .
For those who have not figured this out I'm old school but can handle the new too.
im just cheap, and cheap makes you creative.