The Tartan Army dominated the opening 45 minutes and looked good value to take the lead, but they struggled for momentum after the restart and were on course for another costly home draw.
Under-fire boss Gordon Strachan hinted before the match that he would step aside if his side failed to pick up all three points, though his job was saved in dramatic fashion by substitute Chris Martin just two minutes from time in Glasgow.
Scotland had by far the better of the first-half chances, coming close to an opening goal with just a couple of minutes on the clock when Russell Martin met a whipped Robert Snodgrass corner into the box but was denied by Jan Oblak.
Atletico Madrid stopper Oblak was again needed just 60 seconds or so later, this time to help behind a curled shot from Kieran Tierney which may well have been trickling in.
Hampden Park was less than half full for this qualifier, summing up the current mood surrounding the national side following a run of one win in seven prior to tonight, but those in attendance were out of their seats nine minutes in after Martin this time got the better of Oblak.
The defender's powerful header was ruled out for a shove in the build-up, though, offering a sign of what was to come in a frustrating first half for Strachan and his men.
James Morrison almost picked his spot with a well-taken half-volleyed attempt, while at the other end of the pitch Roman Bezjak tested Craig Gordon - one of six Celtic players to return to the starting lineup - for the only time in the contest.
There was a sense that this perhaps was not going to be Scotland's night towards the end of the opening 45 minutes, as Griffiths somehow hit the frame of the goal when picked out by Snodgrass just a few yards from the target, before doing likewise moments later from slightly further out.
Griffiths, still yet to get off the mark with his first international goal, took a blow to his back late in the first half and hobbled off just five minutes into the second after struggling to shake it off.
On in his place was Steven Naismith, who scored his seventh goal at this level in the 1-1 friendly draw with Canada in midweek, but the change of ploy was not having the desired effect against a Slovenia side with clean sheets in each of their last three qualifiers.
Chances were proving to be far tougher to come by over the next 30 minutes, with numerous crosses into the area being pounced on by Oblak as he went in search of an eighth shutout in 13 outings.
Scotland did manage to carve out the chance they were praying for with 15 minutes to play, only for Ikechi Anya - on the pitch for all of 30 seconds - to come out second best in his one-on-one battle with Oblak.
Just when Slovenia looked to be heading for a sixth draw in their last 10 matches, another replacement in Martin tucked the ball past Oblak to finally find a way through for the Tartan Army.
It was a crucial goal in a crucial game for the hosts, set up by debutant Stuart Armstrong, putting them just two points behind Slovakia in second place and one off Slovenia at the halfway point on the road to Russia.