Is the gap at the front or the back? If it's the back look at the runner bit on the end of the cable that the small bar under tension sits in. It's a black circular bit on a small rod that goes into the plastic housing. If any faults mean the bar isn't under tension the sunroof won't lift up that last little bit.
Hope I've explained it well enough, should be clear when you have a look.