Leak into trunk

I was looking in my trunk today, under the mat, found some water. Had the wife take the hose to it while i was in the trunk with a flashlight.

Turns out it is coming from the bottom of the window.

There is no trim on it. What is the best sealer i can get for selaing the window? Does it need to be completely dry before i can seal it?