I would think the 1996 through 1999 would be nearly the same. I do not know 100% but I have never looked at them side by side. If you are going to consider swapping engines, a couple things to consider.
1. How many miles on the other engine ? It is a couple years older. If mileage is high, like 150K plus, I would consider doing some maintenance on the engine while its out of the vehicle, if you wallet allows.
a. Timing Chain - Much easier to change out when its on the ground.
b. Spark Plugs
c. Water pump
d. Spider Injectors. (these are pretty easy to change, but if the mileage is high, it seems likely they would need changing as you mileage gets higher. To change these in the vehicle, you have to take off a lot of the stuff on the front of the engine(including a/c) and all the wiring that covers up the upper intake manifold cover. If you are swapping the engine and everything is already off, it would probably literally take you 15 extra minutes.
Just a couple things to ponder.
B