There is something I never thought about...Now I have to got to my boat and check it out.
I've had the compass out of the pedestal a couple of times to lube the steering, but never all the way. I don't remember seeing any wiring. I also can't remember the last time I was out at night.
That said, logic would lead one to believe that power would come from the nav light circuit, and the closest point of connection would be the stern light. Just a guess. Otherwise the power could be coming from the same circuit as the instruments and its on whenever the instruments are on, day or night.