If the above (which covers anything else I could also think of related to these brake systems) does not yield any results, and the master cylinder does have a switch/contact to account for low fluid and or excessive pedal travel, you may have an alternator that needs a new set of brushes, assuming the regulator is still working properly.
Alternator brushes wearing out is only a matter of time with high mileage alternators. It is a wear item after all.
Check your voltage across the battery terminals when the light is out.
If the light comes on, leave the engine running and pop the hood.
Check the voltage across the terminals again.
If you have room and won't get burned, check the voltage at the positive/ouput post of the alternator, and the other lead to the battery neg.
I had the brake light coming on and off going back from work one summer. Turns out I was at 11.5V's or battery voltage only when the light was on. My brushes wore out and were on the fringe of not enough pressure to contact the stator properly.