I have no idea what light you are talking about. Does this light normally function with the brake light by getting brighter? If so, then take Critters suggestion. If not then you might just have a contact issue. Possibly corrosion or you might have a broken wire or solder joint. But I'm curious as to which light, on what kind of bike. Maybe a picture pointing to the light would help?
The following would be the diagnostic process I would follow:
check the bulb
check the socket for voltage / corrosion
check the ground for break / high resistance
check the incoming power connector(s) for corrosion / high resistance
If it's not one of these items, I'd be surprised. Please report back what you find for the future benefit of others.