Hampden held a collective breath several times throughout the vital match in the campaign, and let out a bellow of relief when the Fulham striker scuffed a shot beyond Jan Oblak with just four minutes remaining.
Scotland had been bright, hitting the post and crossbar twice in the first half, and having a Russell Martin header ruled out.
Yet it was teetering towards another agonising night of frustration for the Tartan Army until Martin, jeered upon his entrance as replacement for James Morrison, trundled the winner in off the post.
It broke a stubborn Slovenian defence which had held out to almost constant Scottish pressure, and at times – particularly in the first half – fortuitously.
Scotland tested and pressed from the off. They had to win, according to the manager, and the players knew it. Within 90 seconds Jan Oblak, the goalkeeper dubbed world-class in the build-up to the qualifier, fumbled a long hoof forward under pressure from Leigh Griffiths and gifted Scotland a corner.
The Atletico Madrid stopper then pulled off a great save to deny Russell Martin, on the volley, from Robert Snodgrass’ set-piece.
But Oblak wasn’t looking too clever early on and just a minute later, with Scotland frantically overloading the Slovenians, a deflected Kieran Tierney effort was pawed away by the goalkeeper as it spun wickedly and wide.
Oblak was beaten at Scotland’s next corner when Martin rose to head in, but was penalised for a push on Josip Ilicic. The Tartan Army groaned, but certainly not as a consequence of the start made by the national side.
Gordon Strachan billed it as a ‘must-win’ and the players had started like they meant it, and wanted it.
There was patient play from Scotland, too patient at times for the home support’s liking but when the chances came, they were very, very close.
James Morrison fizzed a half-volley just wide after 27 minutes and then on 34 minutes the best chance of the match when Griffiths somehow transpired to volley off the crossbar with the goal gaping, from a handful of yards. Two minutes later, the Celtic frontman smacked the post of Oblak.
It stayed that way at the break with Scotland by far the better side, and only after the interval did Slovenia appear to hold any belief they could see off Strachan’s side – yet tested Craig Gordon just once.
Leigh Griffiths was replaced by Steven Naismith after being subject to a heavy challenge early on in the second period. The sub went close with a header, but couldn’t get much on it, to divert Robert Snodgrass’ cross on goal after 68 minutes.
Play wasn’t quite as thrilling as the first period, but Scotland were still playing it all out in Slovenian territory.
Snodgrass blazed a great opportunity over from the edge of the box with his final touch of the game, and should have at least tested the goalkeeper. Anya, his replacement, did seconds later, and should have made much more of the clear-cut chance, but side-footed into Oblak’s arms.
The bright start was long forgotten and frustration swept across the Scotland support, and players, with every stray pass, and shot going a-begging.
But it came, finally, with four minutes to go when a scuffed strike from Chris Martin, on to replace James Morrison sealed a vital win for the national side.