Gary McDonald and Nigel Hasselbaink scored in the early stages of either half for Saints with Steven Anderson also netting for the visitors, while Joe Cardle was on target for Rovers.
The opening goal arrived on just four minutes as Gary Miller’s free-kick from the halfway line was flicked on by Anderson and McDonald had time to steady himself before sweeping his low shot in off the post.
Cardle levelled the tie on 21 minutes when Gordon Smith laid the ball back to the winger who stepped past a challenge to create some space before crashing a rising 25-yard drive past the keeper.
Hasselbaink (49) restored the lead for the visitors as he used strength and pace as he cut in from the left wing to beat Jason Thomson and Liam Fox before poking the ball past Lee Robinson from just inside the penalty area.
Anderson secured a safe passage to the last four for the Saints when he arrived at the edge of the six-yard box to meet a low Lee Croft corner and clip the ball between Robinson and the post with 11 minutes remaining.
Rovers could have been punished further on 20 minutes from another St Johnstone free-kick, this time on the left flank, when goalkeeper Robinson completely misjudged Brian Easton’s delivery but there were no takers.
Easton later tried his luck from 30 yards when he was first to a loose ball but his low shot whizzed a couple of inches wide of the target as Saints tried to respond to the equaliser.
Anderson was relieved to see his defensive header bounce over the bar and from Cardle’s corner Dougie Hill nodded wide at the far post much to the relief of Saints keeper Alan Mannus.
Rovers squandered an even better chance six minutes before the break when Ross Callachan drifted away from his marker to meet a Cardle free-kick, but the midfielder headed wide from eight yards with the goal at his mercy.
May almost added a third on 52 minutes with a similar run to Hasselbaink, as the Saints striker drifted in from the left past a couple of challenges, but his low shot nicked off a defender and went narrowly wide.
Mannus prevented a second equaliser when he got down at his right post to save a dipping free-kick from Fox and pounce on the rebound ahead of two Rovers players.
Anderson just failed to connect with a low May free-kick on the six-yard line with Robinson completely exposed and James Dunne fired a 25-yard drive an inch past the upright shortly before the third goal.