The Scots were 8-0 down in the 53rd minute and the margin should have been much greater, but after weathering the storm, four penalties from Greig Laidlaw saw them pick up an unlikely victory.
Ireland were missing key players through injury, most notably fly-half Jonathan Sexton, but questions over the future of coach Declan Kidney are sure to intensify as they somehow conspired to lose a match where they enjoyed 74 per cent of the possession.
Injury problems forced Ireland into five changes from the side that lost to England with the most noteworthy new inclusions being Ulster debutants Paddy Jackson and Luke Marshall in the Irish backline.
Jackson – chosen at fly-half ahead of Ronan O'Gara – got off to nervy start as he knocked on after just over a minute and also missed his first penalty, but the opposite was true of Marshall who burst forward twice with attacks in the opening 40 minutes.
Those runs helped Ireland dominate the first half in terms of both possession (78 per cent) and territory (80 per cent) yet somehow they only went in at the break leading 3-0.
Twice they kicked for the corner off penalties deep inside the Scottish 22 but their line-out was sloppy throughout while Keith Earls couldn't quite find Brian O'Driscoll with another attack despite a run from inside his own-half to just five meters out.
Jackson finally kicked over three points with a regulation penalty in the 36th minute but Scotland will have been mightily relieved to go in at the break trailing by only three points especially as they had to survive 10 minutes without Ryan Grant who was sin-binned for a little tug on Conor Murray after the Irish scrum-half tapped a quick penalty.
That yellow might have been a little harsh but there were a couple of incidents when Scotland could have had other players binned – most notably when Robert Harley crashed into an airborne Peter O'Mahony while the Irishman was gathering a high ball.
After spending forty minutes trying, and failing, to get over the try line in the first half, it took Ireland just four minutes to score a five-pointer in the second.
Craig Gilroy spun well and churned the legs over from close range after powerful runs from Sean O'Brien and Rob Kearney got them to within five metres.
Jackson missed the conversion though and Scotland were back to within a score in the 53rd minute when they won a penalty after a rare attack in the Irish half.
Jackson had another chance with a penalty soon after but again screwed his attempt wide as his nervy debut saw him finish with just one for four kicking stats.
Scotland then closed the gap further in the 60th minute when they forced an Irish scrum to collapse – allowing Laidlaw another penalty in front of the posts.
A driving maul off a line-out set up another Scottish penalty just four minutes later. Knowing the penalty was awarded, Laidlaw tried a looped kick over the Irish try line but while that didn't quite work out, he cut the penalty in perfectly from a tough angle.
Now behind, Ireland brought on O'Gara thinking a kick might be the difference, but the Munster veteran's most meaningful contribution was a horribly misjudged one as he inexplicably kicked cross-field just outside his own 22 six minutes from time. The ensuing madness eventually led to another penalty that Laidlaw converted to make it 12-8.
Ireland were awarded a penalty at the other end with three minutes to go and by that stage they felt they had to go for broke. They camped in the Scottish 22' for the final few minutes but some great Scottish defence held them up.
The Irish had one last chance after the 80 minute mark when they were awarded a penalty as Scotland failed to build one last scrum but a knock-on from Marshall ensured a second successive win for them and a second successive defeat for the struggling Irish.