Anyinsah put the Addicks ahead in the 66th minute as they took control in the second half after Scott Wagstaff had cancelled out Zdenek Kroca's opener for the Hatters.
The visitors settled matters with 10 minutes left when Johnnie Jackson's free-kick deflected off the wall, leaving Luton goalkeeper Mark Tyler rooted as the ball went in the opposite corner.
Blue Square Bet Premier outfit Luton made a lively start and they came within inches of taking a deserved lead when Claude Gnapka's cut-back found Danny Crow, whose effort thudded off the crossbar. But the hosts did go ahead when Kroca pounced from close range after Charlton goalkeeper Rob Elliott had kept out Crow's effort following an Andy Drury corner.
Charlton then claimed a barely-deserved equaliser a minute before half-time when a Simon Francis from the right was glanced in at the near post by Wagstaff for his seventh of the season.
The League One side then went in front when Anyinsah flicked in Matt Fry's low shot. A moment of good fortune then gave Luton their third goal when Jackson's free-kick was deflected home to set up a tie with his former club Spurs.