What exactly is your problem or what are you experiencing that you need to pull the headliner? If you are getting a water leak where is it leaking from on the floor or should I say where is the floor wet front or back? Did the sunroof quit working completely or does the sunroof function and close normally?
Unfortunately in order to remove the headliner it practically takes removing all the interior trim panels which is a major job and most average mechanics cannot handle without destroying. I suggested this point would be to pull down the rear headliner trim piece. Click the link below and save for more information on that. There are four Pop clips that hold this panel in place. With this remove you may be able to pop the upper trim panels loose far not pull the headliner down to see if the hoses to the rear drain tubes have come loose from the sunroof track. The drain tubes drain out down to the rear quarter panels of the vehicle there should be hoses sticking out under vehicle. If you blow air up through these you may be able to unclog the hoses if it is still intact with the clamp at the sunroof track.
Before you tear it to the headliner make sure the A/C drain tube is not clogged. Sometimes when the AC evaporator core drain tube gets clogged the water can run down along the floor and end up behind the backseat soaking the carpet.