I was not sure how your wiring is hooked up on the mast. Here are some basics.
First, this is a DC System working off the battery. The red wire should reflect positive or sometimes the hot wire coming off the positive side of the battery. The black wire is of course the negative or the common ground wire coming off the negative terminal of the battery. I would never recommend the black being used for a positive or hot wire.
Why? Once a customer of mine had wiring installed by a dealer who did not know what they are doing. That dealer did not last long. When she hooked up the wires to the battery, battery blew up and of course the contents of the battery as well. Luckily, she was not hurt. Otherwise she would have sued the installer and dealer for injuries.
I do know of one case where a used boat was bought privately and whoever did the wiring caused the boat to burn up. The seller ended up giving the money back following a court decision. If you ever buy a used boat and wiring is not your point of expertise, then hire someone who is from a safety stand point to make sure everything is in order.
Whenever I looked to correct wiring on the mast, my first instinct was to see what lights and wires there were. There are different lights . One light has two light bulbs with a divider to act as both a steaming light and/or anchor light. Then of course there are the seperate individual lights one specifically for steaming and another one on top with one light bulb for anchoring only. In either case, you should have a three wire configuration with two for the positive or hot leads and one single for ground which is black. (Appx. 10 years ago or so, yellow was substitued for black as the grounding color code for DC because shore power black which is an AC current is a black wire.
Safety issue)
The hot wires are then led back to a panel and I highly suggest that a fuse is on every hot or positive wire. The black wire or common ground on DC of course should go to the negative terminal of the battery.
NEVER USE THE GROUNDING ON A KEEL AT ALL AS YOU ARE INVITING QUITE A FEW ISSUES. SAFETY ISSUE.
You probably know this information but believe sir, I have seen quite a bunch of poor work over the years.
crazy dave condon