I would think if it was a sunroof drain issue, the leak would be near the front or middle and not the back. I would suspect the roof rack screw holes. Remove the roof rack. Suck or blow out the holes really well, maybe even spray a little brake cleaner in them. Clean up the screws and reinstall the roof rack with some clear silicone RTV on each screw. This will seal the screw holes and stop the water penetration into your headliner.
But, checking your sunroof drains also wouldn't be a bad idea. I have a video for it. If you park at a slant with the front higher than the rear, water leaking in because the sunroof drains are clogged could show up where you're seeing the stain.
<iframe width="560" height="315" src="https://www.youtube.com/embed/qalXo4etX3Q" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
After doing all that and you still have a leak, maybe drop the headliner and investigate further.
<iframe width="560" height="315" src="https://www.youtube.com/embed/MVJW0XM2x24" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>