It is not the first time that Lewis Macleod has dug Rangers and his manager out of a hole this season, but let it be said that there was nothing remotely lucky about the nature of the victory he earned just three minutes from time with the most deliciously-directed header.

Indeed, in the period leading up to the moment that changed this rather mixed and patchy game, it looked as if luck had run out completely for the Ibrox club and Ally McCoist.

McCoist needed a favourable result. No question. Derek Llambias and a fellow by the name of Barry Leach, the head of brands at Sports Direct, watched the match from the directors' box as plans continue to be hatched for the restructuring of the club.

They will no doubt file a favourable report to Mike Ashley over opportun­ities to splash the name of his leisurewear company all over a larger percentage of Ibrox than it commands at the moment.

There are all those empty seats to decorate for a start. Quite what they make of the budget being spent on the football department is another thing altogether.

A cup exit at the hands of St Johnstone would have put McCoist in an even more difficult position than he finds himself in right now. With time running out last night, he had witnessed Jon Daly hit the post, Lee McCulloch have a goal chalked off for offside, his goalkeeper Steve Simonsen leave the play with a head injury and his first-choice centre forward Kris Boyd continue to look like he couldn't hit a barn door.

The Gods appeared to be conspiring against him until Fraser Aird launched a hopeful ball in from the left and Macleod, probably the home side's most inventive player throughout, took matters into his own hands with his seventh goal of the campaign.

He read the situation well and allowed the ball to glance off his forehead, beating Alan Mannus low to his left from around 15 yards out and sneaking into the corner of the net after taking a bounce. There may have been less than 13,000 Rangers supporters inside the ground as their club's off-field dramas continue to play out, but they made one hell of a noise as the celebrations began. McCoist's reaction was ecstatic, jumping up and down on the touchline before hugging a disabled supporter in the East Enclosure.

Macleod is really showing his worth this season and deserves praise.

Rangers also deserve praise, as a collective, after adding St Johnstone to their list of Premiership scalps alongside Inverness Caledonian Thistle and making it to the semi-finals of the League Cup.

They were pretty poor during the first half and they needed Simonsen to make two good saves to keep them on level terms, but they dominated affairs in the closing 25 minutes against a visiting side that struggled to turn possession into penetration and their late winner came as no real surprise.

St Johnstone offered more interesting ideas and, arguably, more composure in possession, but they had only managed 12 goals in 16 outings before this one and it was easy to see why. There is something lacking up front, they have a largely unproven centre forward in Brian Graham and often fail to take advantage of the few gilt-edged chances that come their way.

Boyd is becoming pretty good at that too. He looks a shadow of his former self right now and was replaced by Daly with 16 minutes to go.

A bad night for him started early with the first of a few missed chances.

With Kenny Miller having seen an attempt from an overhead kick blocked just minutes earlier, Macleod showed terrific pace and presence of mind after picking up the ball in his own half to outstrip Steven Anderson and lay the ball off to Boyd on the left-hand side of the penalty box.

The former Kilmarnock striker shaped his body well to shoot, but his effort went straight at the advancing Mannus and was blocked.

St Johnstone lost their influential midfielder Murray Davidson a little later when, after going down under a crunching challenge from Darren McGregor, he appeared to be struck accidentally by the flailing boot of Nicky Law. He was taken off the field on a stretcher and packed off to hospital to have stitches inserted around his eye while Gary McDonald took the field.

It is not necessarily connected to his absence, but the visitors had a little more joy in the final third of the field towards the end of the opening 45 and squandered a wonderful opportunity just three minutes before half-time.

Lee Wallace lost the ball to Lee Croft on the flank and the St Johnstone midfielder hit the bye-line before sending a deep and searching cross into the area. Frazer Wright had time and space to ready himself, but his header from around eight yards still soared a fair distance over the crossbar.

Wright did atone, to some degree, for that misdemeanour early in the second period when getting in the way of a Boyd shot inside the area after more inventive work from Macleod and it took two fine saves from Simonsen - the second of which resulted in him leaving the field - to prevent Saints from snatching the lead.

Michael O'Halloran found himself clean through on 48 minutes thanks to a fantastic reverse pass from Simon Lappin on the left touchline and it took a fingertip save at full stretch to prevent his angled effort from creeping inside the far post.

Two minutes later, Graham rose higher than anyone to get his head to a Lappin free-kick and send a low header towards the bottom corner.

Simonsen reacted sharply and dived low to his left to turn the ball round the post.

He hit his head off the upright in the process, though, and an air of concern descended upon the stadium as he received a good four minutes of treatment before being placed onto a stretcher, his neck in a brace, and wheeled off round the touchline to warm applause.

Lee Robinson took over the gloves, but was rarely tested during his time on the park. Rangers grew stronger as the match went on and gradually wore down their opponents.

McCulloch saw an effort deflected onto the top of the net on 66 minutes with Daly hitting the near post with a header from a Macleod free-kick just a little later. McCulloch did nod the ball into the net with 10 minutes remaining - only for linesman Michael Banks to have spotted he had moved fractionally offside when Macleod delivered his free-kick from the left - and it looked like extra-time when Macleod blazed an effort miles over the bar a little later.

This young lad is better than that, though. He is growing as a player all the time. Lord knows where Rangers would be, at the moment, without him.