Jeep wj engine swap with a Zj

I have a 2000 jeep grand cherokee with a blown 4.0 engine. I have a friend willing to sell me his 4.0 from a 97 zj Grand cherokee. My Question is will this engine work if I switch over the wiring harness and the controlers from my current setup. The engine I have now uses a coil pack rail. Where as the older style engine uses the distributor. Any help would be great.

Chazz

A Jeep forum might provide more information for this project.