Leyton Orient broke the deadlock after 16 minutes when a cross-field ball picked out Dean Cox on the left of the area and his cross-shot was headed home at the back post by Scott McGleish.
The former Charlton striker appeared to be in an offside position when he applied the final touch but the protests from the home defenders were ignored.
Charlton were back on level terms five minutes after the restart when Jamie Jones could not hold on to Bradley Wright-Phillips' volley and Paul Benson tapped home the rebound from close range.
Charlton took the lead after Jones threw the ball straight to Wright-Phillips, who fired it straight back past him and into the net.
Jose Semedo headed home Michael Stewart's 87th-minute cross to wrap up the points and give Chris Powell's side a much-needed win.