F5 also feeds License Plate lights, so it ...
feeds a Gray/Brown wire, and a Gray/Brown/Yellow wire that run trough the Trunk Hinge Harness.
Do a search under Hinge Harness and you will find plenty of information on this miserable bug on E34's.
Javier
Edit: An easy check is to remove LKM to verify if bug is related to Lamp circuits after LKM (like trunk hinge).
Gray/Yellow wire goes trough splice X245 to ...
LKM pins 7, 27, and to rear and front right side markers. Splice X245 is in the front harness between the Light switch and the LKM, one wire in, four wires out. Gray/Yellow wire for the rear right marker, also goes trough connector X13 (21 pin white connector below driver's foot rest).
Javier
Edit: If you removed both right side markers and the LKM and still get continuity to ground on Light switch Gray/Yellow wire, no doubt you have a short to ground in the Gray/Yellow wire system coming out of Light Switch. You may select to replace all this wire system together running alternate cables (first unplug X13 below foot rest to discard a fault in the rear side marker cable itself, from X13 to the bulb).
How did you detected the short after removing LKM? ...
Put and blown a new fuse? To measure voltage across F5 and find 12V does not mean there is a short there until you are positively sure all load was removed.
You can also test across F5 with a bulb light. If normal brilliance is achieved yes there should be a short. If dimmed, probably remaining load.
Javier