Putting a bead of silicone around it is going to be the best way, UNLESS you can find a source for the seal that the glass shuts against.
I've run across a few of these, and several times the customers have asked me to simply deactivate the sunroof and seal it shut. Did one on an old Explorer a month ago, in fact.
Go to Car Quest and get a tube of their adhesive silicone. It's made by Permatex, and is a lot cheaper than the actual Permatex. That's what I use.
And just so we're clear, I am assuming this is one of the old-style sunroofs that just pop up in the back?
If so, it has no drain tubes. All you can do is seal it shut, again, unless you run across a place to get a new seal for it. (unlikely)