Derek Lyle had levelled the tie at 2-2 on aggregate after 35 minutes when he put the visitors ahead in front of around 50,000 fans, who took advantage of the £5 admission fee.
But stand-in skipper Wallace put Rangers back in front 15 minutes into the second half, before the hosts saw out an anxious final half-hour to set up a Scottish Premiership play-off semi-final date with Alan Stubbs’ team.
Queen of the South had the first chance when Kenny Miller’s poor control gifted the ball to Lewis Kidd, who slipped a pass in front of Gavin Reilly, but he dragged his shot wide of the target.
Two minutes later Wallace exchanged passes with Haris Vuckic on the left side of the visitors’ penalty area and crossed for Nicholas Clark at the front post and the Rangers striker sent his volley inches wide.
Vuckic was involved again when he eventually returned the ball to Nicky Law inside the box and the midfielder’s low drive from 10 yards was turned round the post by Alexander Clark.
And the visitors survived another scare when a defensive mix up allowed Vuckic to race clear, and the on-loan Newcastle man put the ball just behind the unmarked Clark at the edge of the box, allowing the backtracking Kevin Holt to clear the danger.
Doonhamers goalkeeper Clark again had to get down to his left to push another low drive away, this time from the influential Vuckic on 28 minutes.
But Queen of the South stunned the home support 10 minutes before the break with a flowing move from just outside their own penalty area, which ended with Daniel Carmichael clipping a superb cross from the right side of the box, and Lyle arrived to send his downward header past Cammy Bell.
Clark got down to turn a Vuckic free-kick round his right post as Rangers tried to hit back quickly, and at the other end of the pitch Holt tested Bell with a 30 yard drive after Dean Shiels gave the ball away deep in his own half.
Rangers had the first chance of the second half when Clark nodded the ball down to Wallace on the 18-yard line and the left-back’s snap shot was held by the ‘keeper.
Ian McShane then tried his luck from outside the penalty area after a period of pressure from the visitors, but Bell made a comfortable save.
A minute later Miller’s downward header from four yards was somehow blocked by Clark with a wonderful reflex save.
Rangers survived a massive scare when Reilly found himself clean through after latching on to a lofted pass but he lost control of the ball with just Bell to beat.
Instead Rangers levelled the match on the hour when Clark used his chest to lay the ball into the path of Wallace who dispatched his first-time shot past the ‘keeper from six yards.
Clark again frustrated the home side when Law and Vuckic combined inside the box and the ‘keeper spread himself to block the shot from the former Motherwell midfielder.
Vuckic then denied the Doonhamers a second goal when he headed the ball off the line after the ball broke to Lyle at a corner and he curled his shot beyond Bell with 10 minutes remaining.
Rangers were hanging on and manager Stuart McCall brought off two attacking players, Clark and Shiels, for two defenders, Bilel Mohsni and Stevie Smith, in a bid to shore up a shaky-looking backline.
In the end the home side saw out the final minutes, although they had to defend a free-kick in the dying seconds when the wall blocked McShane’s shot, and they will now face Hibernian in the first-leg of the semi-final play-off at Ibrox on Wednesday.
Elsewhere, Alloa retained their Championship status with a 3-0 victory over League One Forfar to win the tie 4-3 on aggregate.