Stand-in Hoops skipper Joe Ledley opened the scoring in the fifth minute with a header before a mistake by Parkhead left-back Emilio Izaguirre in the 13th minute allowed Esmael Goncalves an easy chance to level.
However, Anthony Stokes restored the visitors' lead in the 21st minute with a close-range header and at the end of a decent game it was enough to put Neil Lennon's side into Monday's draw at Hampden.
As expected Lennon had taken action after the Hoops' 2-1 Clydesdale Bank Premier League defeat by Motherwell in midweek. Kelvin Wilson, Efe Ambrose, Joe Ledley and Gary Hooper came back into the Celtic side with Kris Commons, Georgios Samaras and Beram Kayal dropping to the bench and Tom Rogic out altogether.
An open start to the game saw a corner at either end within the first two minutes and the first Celtic chance came moments later in a break - but Stokes took too long to get his shot in and when it was blocked out to Victor Wanyama, the midfielder's side-footed effort was saved by Buddies goalkeeper Craig Samson.
Ledley's goal soon followed, though, when James Forrest raced down the right-hand side before crossing to the Wales midfielder to dip his head and steer the ball into the corner.
Saints levelled after midfielder John McGinn looked for Steven Thompson with a searching pass only for Izaguirre, under pressure from the former Rangers striker, to head over keeper Fraser Forster - allowing Goncalves an unmissable chance from a yard out.
However, the Buddies defence was sleeping when Forrest took a short corner from the right to Hooper before crossing the return ball to the back post, where Stokes knocked it in from close range. The second half began with Samson cannoning a clearance off the head of the onrushing Stokes. It dazed the Irishman, who required treatment before returning.
In the 62nd minute, Forster and stopper Thomas Rogne almost combined to make a mess of a David van Zanten cross, while seven minutes later Mair missed a header which allowed Hooper a clear run on goal. The striker thundered his drive against the crossbar, before Forrest fired the rebound wide.
St Mirren stepped up their bid for the equaliser and 10 minutes from time Forster made a brilliant save from Carey's free-kick from 30 yards, parrying the ball up into the air before Conor Newton headed over. The Celtic goal survived a late scare or two but the visitors held out.