couple of members did that (both ways I think, TJ to YJ and YJ to TJ 2.5L swap).
get all the sensors from your engine, distributor, intake (including injectors and fuel rail), exhaust manifold and waterpump (i'm not 100% on this one but i think you need the YJ one). One issue you will have is with the water temp sensor close to the firewall in the cyl head (is the one for the gauge cluster), it doesn't exist on the TJ 2.5L, the location for the sensor is there (flat portion in the cast) but the hole is not drilled and tapped, you could get it done as it is a 1/8'' npt thread and use your old sensor.
another thing that i recall being different is the oil pan, apparently the TJ one has a different shape due to the exhaust downpipe routing, but i cannot say 100% it won't work, if you end up replacing it then you'll need the oil pump as well as the pickup is also different from what i remember.