But just when Saints were readying themselves for extra time, Boyd pounced from six yards to clinch a narrow win.
The SPL leaders will now face Dundee United in the quarter-finals at home in the first weekend of March.
Walter Smith made six changes to the team that had beaten Hibernian so impressively in Gers’ last outing as he rotated his squad.
Lee McCulloch, Sasa Papac, Kevin Thomson and DaMarcus Beasley were all given a night off while Steven Whittaker and Kenny Miller dropped to the bench.
Back into the fold came Mo Edu as he made just his second first-team start since suffering a serious knee injury last May.
Also included were Nacho Novo, Steven Naismith, Kirk Broadfoot, Steven Smith and Kyle Lafferty after his good impact as a substitute against the Easter Road side.
Naismith, playing on the right side of midfield, was heavily involved in the early stages and was on the end of the hosts’ first two chances.
Boyd played him into space with a great reverse pass in the first instance and his former Kilmarnock team-mate shot across goal and just wide of the target.
Another through ball moments later released Naismith once more but on this occasion Paul Gallacher raced out of his goal early to smother well.
Novo had a go from distance too as Smith’s side tried to settle into a groove – but then Saints nearly snatched a lead themselves.
Andy Dorman sent in a corner from the right and Michael Higdon connected well with it but headed just over the bar.
Back came Rangers, with Madjid Bougherra’s invention on the right wing creating an opportunity for Boyd which he dragged wide on the volley.
The holders seldom looked troubled in the first half but with scores of empty seats around them, the atmosphere was flat and play often suffered as a result.
Neither side built up much tempo and although the Light Blues were usually pulling the strings, they didn’t do much with the possession they enjoyed.
In fact, any balls they got into the box were too aimless and Gallacher had a relatively comfortable opening period.
The one good pass that carved open the away defence came from Novo but Boyd had moved fractionally too early and was just offside when the chance came to shoot.
With half-time approaching, Novo set up Naismith again but he couldn’t quite finish under pressure from John Potter.
The game really needed someone to take it by the scruff of the neck and Steven Davis almost did that just before the whistle.
Collecting the ball 20 yards out, his rasping drive arrowed inches over the upright and it was goalless at the midway point.
Manager Smith resisted the temptation to make changes and the men he kept faith with made a bright start to the second half.
Indeed, Boyd turned the ball into the net at last less than three minutes in – only to be greeting with a raised flag from linesman James Bee disallowing the goal.
The 21-goal hitman appeared in the mood and Broadfoot’s ball inside to Lafferty was chested down for him to volley at goal but Gallacher made a great stop.
At the other end, Lee Mair almost broke the deadlock with a header similar to Higdon’s earlier in the game but it was too high again.
St Mirren were having once of their better spells with nearly an hour gone and Allan McGregor had to react well to save from the oncoming Higdon.
As Rangers tried to dictate play a little more, the Buddies were starting to look more and more dangerous on the break.
Frustration was starting to set in and as time wore on, it seemed the home side might be taken to extra-time for the second consecutive round.
Subs Miller, Whittaker and John Fleck were sent out to warm up and a change appeared to be imminent.
Miller was the first man thrown on for Novo as the Light Blues began to run out of ideas going forward.
Straight away he had a go, trying an ambitious chip from 25 yards that Gallacher had to be careful with as he gathered it on the line.
Davis then burst into life and a surging run from midfield almost forced an own goal but the keeper saved well a point-blank range.
Lafferty did really well to make space for himself but after skipping away from two men, he was somehow penalised by referee Iain Brines.
Quite what for was anyone’s guess and the apoplectic reaction from the home management told you everything about their views on the official’s decision.
Time was running out and Rangers knew it. They turned the screw and suddenly heaped pressure on their opponents, with it finally paying off four minutes from time.
The goal that won this one certainly wasn’t pretty but as it was lofted in by Smith and bounced out of a ruck of bodies after Broadfoot flicked it on, Boyd slammed home.
Miller nearly added a second after he was released by Naismith on the counter but his shot flashed just past.
Not that it mattered. Despite Naismith’s own effort being stopped by Gallacher too, Rangers’ work had been done – if only just.
They’ll now meet the Arabs for a semi-final slot as their bid for three trophies continues to gather pace.