Chances are there will be a wiring loom in a rubber boot that comes from the body into the boot (Trunk) lid. Over time the wires weaken from constant bending and snap. I'd start there if it's there. Not well up on the 5 series. If it is and they are broken, fix it soon as its a fire risk!!!
Good luck.
Good luck.