However, Ireland had only a Paddy Jackson penalty to show for all their possession and territorial advantage.
Six Nations table
Wing Craig Gilroy did cross for the visitors shortly after the restart but four Greig Laidlaw penalties secured the win for the hosts.
On paper, it was a miraculous victory for Scotland - Ireland had 78% of possession and 80% of territory before the break - but the visitors only had themselves to blame for a string of missed opportunities.
For Scotland, it was their first back-to-back victory in the Six Nations since 2001 following their record win over Italy last week.
But for Ireland, it was the first time they have lost two Six Nations games in a row since 2008 and leaves head coach Declan Kidney's future in some doubt.
Ireland came into the match in some disarray,
last week's defeat by England
having ruled out Simon Zebo and Gordon D'Arcy for the tournament and Jonathan Sexton and Mike McCarthy out of the match with Scotland.
With Sexton injured, Kidney picked Ulster's Jackson at fly-half instead of the vastly experienced Ronan O'Gara and the 21-year-old's first touch was a nervy knock-on.
Official match stats
Scrums won (lost)
Line-outs won (lost)
Tackles made (missed)
(provided by accenture)
Regardless, the visitors had the edge in the opening exchanges, with Ulster centre Luke Marshall, also on debut, wreaking havoc in the Scotland ranks.
First, Marshall scythed through the Scotland midfield and set Keith Earls free, only for the Munster wing to be tackled short of the line. And a couple of minutes later Marshall should have put Gilroy in for a try in the other corner after another clean break but butchered the pass.
Ireland continued to apply pressure and prop Ryan Grant was shown a yellow card for interfering with Laidlaw's run after 16 minutes, although Jackson missed the resulting penalty from out wide.
A minute before Grant's re-appearance Ireland had another clear-cut try-scoring opportunity but Earls decided to go on the outside when he had Brian O'Driscoll inside him and was bundled into touch by Sean Maitland.
With Scotland leaking penalties at the scrum and breakdown Ireland continued to batter away at them. But the first points did not come until the 35th minute, when Jackson slotted a penalty from in front of the posts.
Stuart Hogg's long-range penalty attempt came up short on the stroke of half-time but Scotland would have been mightily relieved to be only three points behind. Ireland, meanwhile, should have been over the hill and far away.
Gilroy try puts Ireland in control
The second half started where the first half left off, with Ireland coming in waves. But Scotland's defence, which had hitherto been monumental, could hold out no longer and Gilroy pirouetted over for a try three minutes in.
However, two penalties from Laidlaw reduced the deficit to two points while two missed kicks by Jackson would have increased the visitors' concern. That concern would have turned to genuine fear when Laidlaw gave Scotland the lead with another three-pointer after Ireland collapsed a maul.
Entering the final quarter Scotland looked like the more vibrant side, while Ireland, feeling the need to take risks, began to make crucial mistakes.
O'Gara was introduced after 66 minutes but with Scotland content to kick for territory the Munster veteran was unable to make a mark.
Ireland camped out on Scotland's try-line for the final few minutes but Scotland's defence held firm, with the result confirmed when Marshall knocked-on.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.