It does fit... however the rear window on a YJ hardtop is different. On CJs the rear window has a latch that locks it in place over the tailgate. On YJs the rear window is locked in under (infront of) the tailgate. You're basically just going to have to figure out a way to secure the rear window, otherwise you should be good to go.
Where are you located at? I have a black CJ7 hardtop that I'd be willing to let go (I'm in Northern Virginia).