inside tailgate lamp

my lamp seems to make up it's own mind on whether to turn on or not when the tailgate is open. sometimes it turns on, and sometimes it does not.

would anyone know where the sensor is for this so that i can clean it. or any other way to trouble shoot the problem.

thanks
 
Back