You most likely have a faulty brake light switch. While it seems like your transmission and brake lights aren't related, they are; there's a switch attached to the brake pedal which activates your lights when depressed, and the same switch activates a solenoid on your shifter to allow you to shift out of park.