The two share a platform, but not an architecture.
The 4.0L "fits" in the Nitro but not in the Liberty.
It was never engineered for it.
I'm pretty sure that someone could theoretically make it fit, but remember you gotta get wiring harnesses, the W5A580 transmission (NOT the 42RLE), which then has to hook up to the Jeep's transfer case... a new transmission shifter... and much much MUCH more crap. Because the architecture is different, who knows, the mounting points, etc may not even exist in the KK!
It's just a big huge mess. Remember, just because they share a SIMILAR boxy shape doesn't mean that they are the same. A visit to the plant and looking at the differences between the jobs on the two vehicles, and you would understand.
I work at Jefferson North, we build the Grand Cherokee and Durango on the same line. It really irritates me when people say that the Durango is just a reskinned Grand Cherokee.
To them, I go...
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA!!!!! Work the line then come back and tell me that.

BTW: The KK was engineered first (really as the KJ, and then warmed over) THEN the KA was engineered. The KA was just LAUNCHED first. At one point, KJ, KA and KK all went down the line together.