Not really seeing a brake light switch here:
https://www.realoem.com/bmw/enUS/sho...diagId=34_0986
There is a hand brake light switch however.
Lots of complicated parts to an X5 brake system; do you know of an indy BMW garage in your area? I do via BMWCCA.