Gordon Strachan's side managed to weather the early pressure from Slovenia and, 32 minutes into the game, took the lead through Leigh Griffiths, who connected with Darren Fletcher's looping header into the box to rifle beyond Jan Oblak.
Scotland held on to their one-goal advantage going into the break but, just five minutes after the restart, Slovenia drew level, as a cross whipped into the box saw substitute Roman Bezjak head the ball past Gordon.
From then on, the visitors wilted under a barrage of Slovenian pressure and, in the 71st minute, Srecko Katanec's charges edged into the lead through Bezjak's second of the game, the 28-year-old making the most of a lacklustre defence to slot home following a corner kick.
Scotland mounted a late fightback and, with two minutes left of the game, a ball over the top found its way to Robert Snodgrass and was hooked high into the net beyond Oblak to give the Tartan Army a fighting chance.
There was yet time for more drama in the game as Slovenia captain Bostjan Cesar was sent off for two bookings in quick succession, but unfortunately for Scotland, they could not find a winner.