Airdrie lost 'keeper Stephen Robertson iin the pre-match routine with a back injury; Lee Hollis stepping in.
Airdrie's Steven McDougall should have done better than send his effort wide with a header from Stephen McKenna's corner, and Willie McLaren's drive flew past as the visitors sought first advantage.
McDougall had to retire with a head knock after only 10 minutes, Brian McPhee taking over, but Saints had opened the scoring a minute before the substitution. Simon Lappin's free-kick from wide out on the left was headed powerfully past Hollis from 12 yards by John Sutton.
Airdrie replied with a Stephen McKeown shot which Tony Bullock fielded awkwardly. Lappin put the visitors on the back foot again with a clever run and cross which Iain Anderson met 20 yards out, but his drive was comfortably held by Hollis.
McPhee was sent off for a dangerous-looking lunge at Kirk Broadfoot just after the half-hour but, although Billy Mehmet tested Hollis again and the 'keeper's legs denied Sutton, the visitors stunned the anxious home support with an equaliser.
In a scintillating move, McKeown drew the Saints' defenders to the left, leaving a huge gap for Willie McLaren to find Kevin Barkey on the right with a long pass which he knocked into the middle for Bryan Prunty to score with a firm header.
What proved to be the winner came just two minutes after the break. Lappin's short corner was sent to the far post by Hugh Murray from where Kevin McGowne headed it goalwards. A scramble ensued and Sutton prodded the ball in off a post.
Airdrie's 10 men fought valiantly with McKeown inspirational in midfield and Neil McGowan firm at the back. They tired, however, and David van Zanten's pace forced Hollis to block at the edge of his area.
Sutton fired wide after a slick move and Hollis palmed away a van Zanten thunderbolt.