For the third consecutive season, Gerrard suffered a quarter-final defeat as his new Premiership champions lost on penalties to a redoubtable St Johnstone side aiming to add the Scottish Cup to the League Cup triumph they enjoyed back in February.
Having taken Rangers into extra-time, the Perth outfit appeared to have been undone when Rangers captain James Tavernier scored his 18th goal of the season in the 116th minute.
But in an extraordinary finale, St Johnstone equalised two minutes into stoppage time when goalkeeper Zander Clark’s decision to go forward for a corner paid off when his header was turned in by Chris Kane.
It was appropriate that Clark should come to Saints’ rescue, having made several fine saves during a tie largely dominated by a Rangers team who generally lacked a cutting edge.
Clark’s heroics weren’t over there as he made two more stops in the shut-out, keeping out efforts from Tavernier and Kemar Roofe, while his outfield team-mates proved faultless from the spot.
It is a painful setback for Gerrard, irrespective of him having already delivered his primary objective this season in winning the Ibrox club’s first league title in a decade.
After beating holders Celtic in the previous round, this was an opportunity to make an even more emphatic statement that Rangers are now ready to establish themselves as the pre-eminent silverware gathering force in Scottish football.
Instead, they slumped to only their second domestic defeat of the campaign after their League Cup exit at St Mirren last December.
Gerrard had made no secret of how much he wanted to end Rangers’ wait for a first Scottish Cup success since 2009 but his team never found the intensity and fluency needed to overcome Callum Davidson’s superbly organised side.
Despite Gerrard restoring all of his key players to his starting line-up, making five changes from the 1-1 draw between these teams at McDiarmid Park in midweek, too many of them were some way short of their optimum form.
Although Allan McGregor wasn’t as busy as Clark, the Rangers goalkeeper did have to make the best save of a subdued first half when he kept out Scott Tanser’s stinging volley. Joe Aribo and Alfredo Morelos, the latter well policed by Saints’ impressive three-man central defence, passed up Rangers’ clearest openings before the interval.
The hosts looked to step it up at the start of the second half as Clark saved well from Morelos before the Colombian striker was unlucky to see a header from a brilliant Tavernier cross hit the goalkeeper’s right hand post.
Rangers appeared increasingly determined to finish the job inside 90 minutes but they simply couldn’t find a way past Clark who made further excellent interventions to keep out close range attempts from Morelos and substitute Scott Wright.
As the match went into extra-time, St Johnstone had already secured a notable achievement of sorts by becoming the first Scottish team to prevent Rangers from scoring in regulation time at Ibrox this season. They weren’t about to settle for that.
Extra-time was nervy and a mistake by Filip Helander, who then had to limp off injured, almost let Saints substitute Michael O’Halloran in for the opener. But the former Rangers striker couldn’t get the better of McGregor who raced off his line to make a good save in the 109th minute.
It looked as if it might prove to be a pivotal contribution from the veteran goalkeeper as Rangers finally made the breakthrough seven minutes later. Aribo found space on the right of the Saints penalty area to clip in a cross which Tavernier, climbing above Liam Gordon, steered wide of Clark’s right hand with a firm and precise header.
Having been so effective defensively at Ibrox all season, Rangers would be expected to see out the closing stages and book their place in the semi-finals.
But the late concession of a corner kick proved fateful as Liam Craig swung it over from the right. So often, goalkeepers making a last-gasp charge into the opposition penalty area proves to be a fruitless exercise in desperation. Not this time.
Clark wasn’t picked up by the Rangers defence as he won the ball in the air. His header might have been sneaking beyond McGregor in any case but Kane’s touch made sure of the equaliser.
There was only enough time left for Gerrard to send on Jermain Defoe to be one of his penalty takers before the final whistle blew. But while the veteran striker and Borna Barisic both converted their spot-kicks, Rangers never recovered from Tavernier seeing the opening kick of the shoot-out saved by Clark.
Craig, Callum Booth and Jason Kerr all scored in exemplary fashion for St Johnstone before Roofe’s unconvincing attempt was kept out by Clark. It was left to Ali McCann to win it for Saints, the young midfielder giving McGregor no chance and sparking wild celebrations among the visiting players as they savoured their club’s first ever win over Rangers in the Scottish Cup.
Rangers (4-3-3): McGregor, Tavernier, Goldson, Helander (Simpson 111), Barisic; Kamara, Davis (Defoe 120+2), Aribo; Hagi (Wright 68), Morelos (Roofe 82), Kent. Subs not used: McLaughlin, Itten, Stewart, King.
St Johnstone (3-5-2): Clark, Kerr, Gordon, McCart; Rooney, McCann, Craig, Wotherspoon (Bryson 71), Tanser (Booth 101); May (O’Halloran 75), Melamed (Kane 58). Subs not used: Parish, Brown, Gilmour, Conway, Ferguson.