Lights and panel will go off after applying brakes.

Hello guys and thanks for your help before hand, so I have a 2008 GEM es and for quite some time every now and then I use the brakes the lights will shut off and will start beeping, it will stop when I take the foot of the pedal and then the lights will come on again, also the panel will dim down, I was hoping if someone run into the same problem and how was fixed thank you.