Rear lid contact switch
WARNING: This page is about a different car, the 2013 BMW X5, 2012 BMW X5, and 2011 BMW X5. However, it is still accessible from the selected car via links, so may be relevant.
When the tailgate is closed, tailgate contact switch switches to earth. The status of the tailgate contact switch is evaluated and made available by the junction box electronics.