Ethan Pinnock grabbed an 85th-minute winner as Brentford scored twice in the final quarter of an hour to fight back and keep the pressure on the top two.
The Bees, who regain third spot and are just two points adrift of second-placed West Brom having played a game more, trailed to Macauley Bonne’s header.
But Said Benrahma’s penalty levelled things up and Pinnock completed the comeback.
Charlton went ahead early on when Bonne headed in after Jake Forster-Caskey nodded back Alfie Doughty’s cross.
The Bees completely dominated after that, but wasted numerous chances through a combination of poor finishing and some excellent goalkeeping by Dillon Phillips.
Mathias Jensen, Christian Norgaard and Benrahma all went close in the first half and, although Jason Pearce hit the bar for the Addicks, the home dominance continued in the second half.
Benrahma sent a half-volley over, Josh Dasilva had an effort well saved by Phillips and was also just off target with an attempt before the pressurefinally told.
Benrahma was the man to draw Brentford level with a confident spot-kick after being felled in the box and victory was secured when Pinnock cleverly flicked the ball home.