In spite of the scoreline, this was a jittery affair for the Premiership club, who had failed to win any of their seven home games prior to this tie.
Even so, the victory came as a relief to home manager Gary Locke, who has been under pressure following a run of performances every bit as poor as the results.
It did not help that their part-time opponents, superbly marshalled by player-manager (and former Scotland midfielder) Colin Cameron, started on the front foot.
Leading scorer Blair Henderson ought to have opened the scoring in the third minute when he created space for himself in the Rangers penalty area but his close control was undermined by a wayward finish.
Midfielder Michael McKenna then went close with a shot from 20 yards before the same player gifted Kilmarnock the lead against the run of play.
His challenge on Greg Kiltie was as needless as it was reckless and Kris Boyd accepted the responsibility of converting the resulting penalty, beating Kevin Walker low to his right.
Boyd also struck the post with a shot from distance and saw a header cleared off the line by Rangers captain Jonny Fairbairn, but the visitors still posed a threat on the break.
Cameron, weeks away from his 43rd birthday, continued to cajole his troops and they drew level 10 minutes after the restart when Darren Lavery took a pot shot from 20 yards which left Jamie McDonald helpless.
He also raised the hopes of the tiny band of travelling fans with two goal-line clearances to deny Boyd.
Unfortunately for the romantics, Rory McKenzie restored Kilmarnock’s lead with a shot which was deflected behind Walker.
That may have been cruel on the League Two side but there could have been no complaints about Craig Slater’s clinching third goal.
The midfielder slalomed his way through the Rangers defence before delicately lifting the ball over Walker as he left his line to narrow the angle.
Slater could have had another but his shot from distance struck the crossbar.
However, substitute Kallum Higginbotham provided the icing on the cake with a stunning strike from 25 yards in the final minute.
Walker needn’t have bothered making the effort to dive as the ball flew into his top left-hand corner.