NY is tricky. They are one of the California Emission Standard states, so they are very strict. The engine does have to be the same year or newer than the vehicle.
Since the TJ started production in 1997, it is an OBDII vehicle and therefore has to submit to the more stringent emissions testing.
One of my friends was thinking about doing this for his TJ on D60's and 40's. He checked into it, did a lot of research. Engine swaps in California Emmision Standard compliant states are a pain in the ***. Very tricky, too. If the engine is newer or same year V8 as the chassis, you would need to complete the swap with the same emissions equipment as factory (catalytic converters, some sort of muffler, etc), have the computer flashed or otherwise reprogrammed to talk to the TJ so it doesn't throw the Check engine light, then bring it to your local DMV, and schedule an inspection. You can't just bring it to a shop or quickie oil change place and have them do it, an actual DMV official would need to sign off on it. Basically, it would be getting a new VIN/Title and would be classified as a kit/home built vehicle, much like a hot rod or street rod or kit car. Do your research on NYS custom built vehicle registration. There is a section for it on the DMV's website I believe.
I was thinking about doing a Hemi conversion to my TJ eventually, but with all the hoops you have to jump through, and the fact that I only run 33's, I may just rebuild my 4.0L and run that for another 150k mi. I'd rather be wheeling my Jeep than fussing with an insanely frustrating engine conversion. if i want HEMI power, i can drive my charger
That said, I know of some guys who put corvette LS motors into their TJ's. But they own a shop, so I think they went on the sly and just slapped the NYS inspection sticker on it without actually running them through the tests, cause last i heard these guys didn't even go through the re-register process.
Hope this helps. Good luck.