I had an 87 that had a CJ7 hard top on it and you had to close it carefully or the tailgate and hatch would interfere with each other.
Does your hardtop have the long black vents up the rear corners and an all glass hatch(YJ)?
or no vents and metal framed hatch(CJ)
If you do have the correct YJ top, the procedure is to open the tailgate first, then the glass hatch