If they have the retaining bead, you need to pop that out and that will allow you roll the gasket back from the top and the glass. Run a strip of masking tape around the edge of the gasket against the top and also on the glass. You can then run a bead of silicone or other sealant between the glass and the gasket and also between the top and the gasket. You can mask the gasket as well if you want. Put the retaining bead back in, remove the excess sealant, and then remove the masking tape. I just did it to my windshield on my Range Rover today. One other thing, before you put the sealant in, clean really well between the surfaces of the gasket, glass, and top. I used denatured alcohol to clean mine. Use a sealer that will remain flexible. A glass shop or a good auto parts store should have what you need. I used silicone on mine, but there are probably better things out there. I was going to go to the glass shop and get some window sealer, but they were closed today and I am tired of water leaking around the windshield, so silicone will just have to do...
If they don't have the retaining bead it's a little harder to get it to seal and your best bet is new gaskets. You can still try to work some sealer in there, but it's harder since the gasket won't pull away from the glass or the top as easily.