Just took my '03 E500 into the dealership for the same message. Brakes work fine, but message goes on and off intermittently. Dealer said it was a failing brake stop lamp switch and wanted to charge me $265 for it. Found this thread:
Total spent - $10.88
Total Time - Under 10 Minutes
Try this first as it is an inexpensive and easy way to trouble shoot the problem.