Scott Niedermayer had a goal and assisted on the winner for the Pacific Division leaders, who are in a race for the best overall record in the NHL with 106 points.
David Backes and Lee Stempniak scored for the Blues, who finished 18-20-3 at home in a rebuilding season after finishing last overall in 2005-06. The Blues finish with four games on the road, and the team got a standing ovation from a near-sellout crowd of 18,609 before leaving the ice.
McDonald has 26 goals for third-best on the team, but had been scoreless in his previous six games. On the winner, Niedermayer lofted a pass through the Blues' defence to the hard-charging McDonald, who poked it past Jason Bacashihua on the only shot for either team in the extra period.
The Ducks scored on their first two power plays, giving them five straight goals with the man advantage, before finally coming up empty late in the second period. Anaheim had been 5-for-30 the previous seven games.
Goalie Jean-Sebastien Giguere was credited with an assist on the game-winner for Anaheim, which has won four of five and is 12-3-2 in its last 17. Giguere stopped two short-handed breakaways in the final three minutes, thwarting Jay McClement and Radek Dvorak.
McClement came up empty on a two-on-none break after defenceman Francois Beauchemin fell down, and splintered his stick on the bench on his way off the ice.
Stempniak's 25th goal early in the third tied it 2-2. He had an open net after Barret Jackman's shot from the left point bounced off the back wall and emerged on the right side.
McDonald had given the Ducks a 2-1 lead midway through the second when he broke in alone on after Chris Kunitz won a battle for the puck along the boards.
Niedermayer scored his 14th goal on a rebound at the two-minute mark of the opening period while Radek Dvorak was off for hooking, and Backes answered for St. Louis at 14:07.
Backes beat Giguere from the slot after McClement intercepted a clearing effort, scoring his first goal in 10 games.
Notes: Stempniak has a goal in each of his last two games after totalling two assists his previous seven games. ... McDonald totalled two assists in his previous six games. ... The Ducks were 3-1 in the season series against the Blues, and have won six of the last seven overall.