Leak is usually the 3rd brake light. The foam dries and crumbles allowing rainwater to pass easily. It can leak on either side or both depending on which side where the truck is leaning when its parked. The water gets routed down the trim towards the bottom of the inside tail gate.
To confirm, carefully remove the the trim piece that covers the inside upper portion if the rear hatch. The opening that the brake light wire routes through: look for staining wetness inside the access or any of the exposed holes, the sides and inside surface of the trim. Another area moisture from the brakelight leak collects is at the bottom of the tailgate hatch seal. Remove the flipdown cover and inspect there as well. Pull the seal and check if there is any corrosion where the pinch welds are and the sheet metal is bonded.
View attachment 1938801
View attachment 1938802
To repair: choose a good silicone seal: good temperature resistance and UV resistance. I found a good option at HD which comes in 6 different colors- so something is bound to match your vehicle or just select clear. GE Silicone 2*+ for exterior windows, metals, vinyl, it's 100% weather proof, rain ready in 30 minutes, UV stable, sun & freeze proof.
Remove the upper deflector, to remove the light. Two nuts on the inside of the hatch secure the light. Disconnect the light and remove. Remove any adhesive, and crumbling foam. Lay a bead of silicone around the sealing surface where the foam was, and also the the based of the mounting studs. Insert the light and tighten down being careful not to over tighten thereby cracking the light housing. Once that is secure, lay a bead of silicone around the exposed gap all the way around the outside of the light. This is a secondary step to divert water around the light.
View attachment 1938803
Put your wind deflector back on and let it dry.
View attachment 1938804