Defender Maynor Figueroa smashed home a late winner to ignite his side's survival battle in the Premier League with a 2-1 win over Birmingham.
Birmingham led after six minutes when Martin Jiranek's flick-on found Liam Ridgewell who reacted quickest to shoot past Ali Al Habsi.
Substitute Curtis Davies' first touch almost created a second goal when he headed Sebastian Larsson's corner back across the six-yard area where Cameron Jerome's shot was blocked by Al Habsi.
Tom Cleverley then restored parity, though.
Ben Watson's brilliant pas picked out Emmerson Boyce and Ben Foster could only push his cross into the path of Cleverley who scored from close range.
Foster was stunned when a late shot from Figueroa whistled past him in the 92nd minute to earn the Latics the points.