I had the same problem with water leaking. I thought it was the third brake light so I taped it off and water tested it. I was still getting water. I also pulled the headliner to see if the rear sunroof drains were clogged but they were not.
I figured out that water was coming in under the gasket and trim on the side power windows. I removed the windows and pulled the black trim. I used some closed cell foam over the holes where the trim attaches. The OEM gaskets were pitiful. The trim attaches with those push clips. I made a hole in the closed cell double sided foam and the clip went right through. To me, this was an improvement over the OEM gaskets. I can't believe they haven't leaked before now. It fixed the water leak on the sides.
Little while later the leak returned. At this point I was lost. I pulled the third brake light and bought some 3M sealant to try and reseal the light. It was a TERRIBLE idea. The 3M stuff didn't hold and it was almost impossible to get off. In the end, I just bought the new light...184.00 and now the leak is fixed. If I had to do it over again, I would just buy the light and be done with it.
I also bought a new rear hatch gasket since that was the last thing I could think of that it could possibly be. If someone needs that gasket, I have one I can let go of. I think it was about 75.00.
Good luck.