No brake lights

My mazda miata has no brake lights when the headlights are on. When the headlights are off the dash lights up when I step on the brake.

There is power back feeding into the circuit. That usually means a poor ground connection somewhere.

How can I find out where it is?