Brake light out, but not when I set alarm

Ihave a 2003 Subaru Impreza Outback. The rear right brake light does not come on when you tap the brake pedal, but the same light (same bulb) comes on when you set the alarm.

Any ideas what the problem is?

Sounds like it’s time to replace the bulb, besides it’s the cheapest test. There are 2 filaments in the bulb, 1 for tail lights, and another for brake lights. I believe that the alarm is attached to the tail light filament.

Which brake light are you referring to? The 3rd (high mounted middle) brake light, or the ones on the sides?