The visitors will face St Mirren in Paisley in the next round thanks to goals from David McCracken, Steven MacLean and Gregory Tade.
Cowdenbeath's Central Park was able to host the tie at the fifth time of asking, and the Irn-Bru First Division side can be proud of a competitive performance, even if they were ultimately undone by the superiority of the visitors.
Having played out a pulsating 2-2 draw with Hearts in the Clydesdale Bank Premier League two days ago, St Johnstone boss Steve Lomas opted to shake things up with five changes to his starting line-up.
Weary legs were of greater concern to Cowdenbeath player-manager Colin Cameron. The former Scottish international omitted himself from the starting line-up after featuring in his side's 2-0 defeat at Falkirk on Saturday, their first game in three weeks.
The ring rusty part-timers submitted the running of the play to their full-time counterparts but created an effective wall between St Johnstone and their goal frame, with the early chances for the SPL side coming from long range.
No clear-cut chances were forthcoming in the opening 30 minutes - and it was the hosts who came closest to opening the scoring.
Slack play in the centre led to a Cowdenbeath break with Mark McKenzie being given sufficient time to whip in a deep cross from the left. Lewis Coult's cushioned header found Dean Brett but the attacker's drilled shot went past the far post.
With the hosts finding their feet the game opened up and Liam Craig was granted too much space in a central area where he cracked the post from 20 yards out.
At the other end McKenzie went close with a low shot which evaded the far post before Lewis Milne led a counter-attack that ended with a powerful drive from 25 yards that Alan Mannus did well to tip over the crossbar.
Either side of the interval the visitors were wasteful in front of goal with Nigel Hasselbaink meekly passing into the arms of goalkeeper Thomas Flynn, before Tade rolled an effort from the edge of the box wide of the target.
The visitors finally found their route to goal in the 54th minute. With the imposing Joe Mbu off the park receiving treatment, Cowdenbeath failed to sufficiently deal with a set-piece and were lucky to clear for a corner.
Their luck ran out though - although Flynn pulled off an outstanding save to deny Steven Anderson, the ball was knocked out to McCracken who drilled the ball through a ruck of bodies and into the net.
The following 10 minutes saw St Johnstone waste two great chances to settle the tie.
Hasselbaink's low drive from 15 yards was blocked by his own team-mate, a wandering Tade, then Anderson headed over from almost underneath the opposition crossbar.
The visitors' wastefulness almost cost them immediately with McKenzie being sent free on the right - but once again Cowdenbeath saw a low effort inch just wide of the far post.
It was through the aid of the referee's whistle that St Johnstone saw their passage assured.
Flynn was adjudged to have brought down Murray Davidson after the midfielder had raced onto Craig Beattie's pass and attempted to round the keeper - and MacLean despatched the resulting spot-kick into the bottom corner.
Tade rounded off the win three minutes from time when he broke the offside trap, rounded Flynn and rolled the ball into an empty net - staking a claim for a starting place in this Saturday's match at Aberdeen in the process.