I would think (year and model aside) that the "brake pad wear" indicator is flickering, not the check engine light. If indeed, the CE light comes on when braking, then someone crossed some dash wiring somewhere!
The "brake pad wear" indicator is yellow, and the icon looks like a circle with dashes around the left and right circumference.
The brake pad sensors are attached to the pads and are designed to contact the disc when the pads reach a certain wear limit. That contact is ground, and it completes the circuit to set off the light on the dash. So you probably have around 2-5K of pad life left (depending on your driving habits).
Some cars have sensors all around, but most just have them on the fronts only. More than likely, it's time to get a new set of front pads.