I seriously doubt it's legal. Just keep looking for a 5.0. I got mine about 6 months ago for only $2,000 with all the mods in my sig. Just gotta get lucky. Oh and I passed smog with all these mods in California. Just gotta make sure it's tuned up good.
If it was an option for that year vehicle, then yes. In otherwords 87lx 4 banger, you can swap a same year or newer 5.0 because it was it an option. You must of course swap all of the emissions hardware and have it functional.
You'd have to have a donor 5.0 car to get everything you need to make it really legal - and it would have to have all the emissions tuff in good working order.