That didn't come out right, what I meant to say was how do you know the water ingress and the tailgate fault are related? I've had to look at the wiring diagram for my tailgate too and was going to suggest looking at the wiring for 7th gen tailgate as well as I doubt they're that different.
A link to 7th gen workshop manual is in in my signature.