I (sort of) did it once on a coupe with the rear window broken out. The lining is retained by the window seal around the mounting flange. IIRC you'll have to remove the plastic trim inserts, then the rear window, then the rear window seal, then finally the fabric headliner. It's not impossible, but definitely a lot of work to get it right.
I also use a bit of fabric adhesive to keep the headliner in place long enough to mount the seals, especially on the sunroof and rear door seals.