[I did answer your actual question in my rambling. I put it in bold...]
Couple main questions: First, are you going to run fuel injection, or slap a carburetor on it? Second... do you know what you're getting into? Because this will be a big, expensive project.
More things:
Was the 87 a four cylinder or a six? That will matter because the motor mounts were different, and if it was a four you'll need to cut the old mounts off and weld on the six cylinder versions.
The yj wiring harness came in chunks; power distro, engine, under dash, front and rear. The front and rear are both just a handful of wires each for the lights (and the horn up front). I'd plan on redoing them both. The front one from any old YJ will be finished. They get alternately cooked and frozen, and the wires and fixtures get brittle. All the pieces are available to easily string a new loom; I did mine in an afernoon. The back loom is a little better protected, but still takes a lot of abuse and isn't hard to redo. There's also a part of the engine loom that runs back to the fuel tank. For fuel injection, it's three wires; fuel pump, gauge and ground. Once again, if I was starting from where you're at I wouldn't be looking for a used version, I'd start clean with new, good quality wire. You do not want any trouble from the fuel pump circuit on a FI engine.
If you're going with fuel injection, the under dash and engine wiring will need to match, complete with the computer. For all that, I'd look at using TJ stuff if you're going to use the TJ engine. Everything will be a lot easier to find and in better condition. That will mean your yj switches and gauges will need to be wrangled, but any way you look at this project you're going to have to wrangle something. I'd much rather do switches and gauges than try to create a frankenstein fuel injection system.
If you're just going to throw a carb on, things get a lot easier. You can find yj under dash and power distro looms in reasonable shape, download the wiring diagrams and start figuring out what you do and don't need. Frankly, it's not the way I'd go, even if it's a lot easier. I grew up wrenching back when it was all carbs, and am totally done screwing with them. I like how fuel injection just works.
Good luck!