The Scots dominated the first half yet failed to make it fully count on the scoreboard. They created numerous try-scoring opportunities but lost possession at vital moments and had to settle for a narrow half-time advantage as three Stephen McColl penalties gave Scotland a 9-3 lead.
After the break a second Irish penalty was followed by the sinbinning of Scotland's Adrian Duncan on 50 minutes, but McColl struck his fourth penalty as the Scots restored their six-point lead.
After a heroic defensive effort Scotland looked to have repelled the Irish but the referee decided there would be one more play and the pressure finally told as Ireland drove over to leave an easy conversion to steal the game 13-12.