You'll need the 4.0L, transmission and transfer case too since the 4.0L won't bolt up to your transmission. Don't forget the 4.0L computer, you'll need it. You're talking $1500 to $3000 cuz you'll need a drivetrain the same year as your Jeep or newer.
It's more money and a LOT more headache than trading up to a 4.0L TJ, and a factory 4.0L will have a cleaner engine bay and wiring install.
AND you'll have to cut the 2.5L motor mount perches from the frame and weld on or fabricate motor mount perches for the 4.0L. This is the point of no return.
If it would bolt up to the transmission and motor mounts, this would be a no-brainer, but it's not that easy. Usually easier and cheaper to bolt in a common GM 350 drivetrain.