The improving hosts matched the side ranked number one in the world in an enthralling first half, with Huw Jones and Mack Hansen trading tries.
Despite a glut of injuries, including both hookers, Ireland found a way to earn an eighth successive win over Scotland as James Lowe and Jack Conan touched down against opponents who badly lost their way after the break.
With out-of-sorts England suffering a record home loss to France on Saturday, Andy Farrell's formidable squad are now heavy favourites for a repeat of 2018's clean sweep.
This was billed as one of the matches of the championship. Scotland's best team of the Six Nations era against Ireland's best team ever.
Scotland were led out by Stuart Hogg on the occasion of his 100th cap and if there were nerves in the Hawick man's stomach, they were mirrored by his team-mates in the opening exchanges.
One of the key elements of Ireland's victory on their last visit to Edinburgh in 2021 was the disastrous meltdown of the Scottish line-out.
The memories came flooding back when George Turner failed to find his man with his first two throws, one of which led to Ireland crossing the try-line, only for the score to be ruled out because Turner had taken the quick throw with a new ball. Saved by the rulebook.
After limiting the damage to just three points, the Scots went down the other end and battered the Irish line until the door was prised ajar and Sione Tuipulotu sent Jones careering through to score.
The world's number one side were unlikely to be spooked so easily and Hansen finished off a fine passage of play to edge Ireland back in front.
Where the Irish have had the edge on Scotland, and indeed most teams these days, is in the collisions, but the home side were giving as good as they were getting. At times it was brutal and a lock on either side - Richie Gray and Iain Henderson - departed with injuries early on.
There has been an inevitability about matches between these two in recent times, a sense of Ireland simply softening Scotland up before putting them away with a bit to spare.
In the first-half it felt different, like two serious sides slugging it out. Both teams managed to work their way to the brink of the try-line only to be denied by some extraordinary defence.
With both Irish hookers, Dan Sheehan and his replacement Ronan Kelleher, forced off, it seemed there may never be a better time for Scotland to break a long pattern of Irish dominance.
For most sides losing two hookers is a crisis, but Farrell's men barely noticed. Josh van der Flier threw perfectly well into the line-out, while substitute prop Cian Healy slotted in at number two and promptly helped his side win a scrum penalty.
Rather than induce panic, Ireland's misfortune seemed to inspire them.
Having laid a decent platform from which to kick on, Scotland could not get going after the interval. On several occasions they found the unlikely figure of Hansen over the ball at the breakdown to puncture their momentum.
The winger was emerging as the game's dominant force and a brilliant take in the air from a Jamison Gibson-Park high-ball put Scotland in trouble from which they could not recover, Lowe going over in the corner to put Ireland in the box seat.
Ireland were smelling blood. The green jerseys were now powering over the gain-line and Hansen put Conan away for a third try. Johnny Sexton's successful conversion drew him level with Ronan O'Gara as the Six Nations record points-scorer.
Scotland had rallied from 19-0 down to give France an almighty scare in Paris, but this particular situation was never going to be rescued.
Garry Ringrose was the latest to be added to the casualty list with a nasty head knock before Scottish star Finn Russell hobbled off in the final moments.
These teams will meet again in the final match in Pool B of the World Cup in France later this year. Scotland have proved they can compete with Ireland, they can hurt them. They have yet to prove they can beat them.
Given the feeble nature of England's defeat to France, there is little to suggest this championship will end in anything other than huge celebrations in Dublin.
Scotland head coach Gregor Townsend: "I'd rather talk about the first half than the second half, because the second half was disappointing.
"We created chances in that first half - it was a real high energy performance. What you'd call a proper test match.
"Both teams were a little fatigued at the start of the second half, it was there for us to lift the energy. We didn't, we weren't accurate enough. Ireland grew in confidence and were clearly the better team in the second half."
Ireland head coach Andy Farrell: "That was an amazing test match. A bit of organised chaos at half-time, but everyone had a smile on their face. Scotland probably didn't know what was going on second half at hooker!
"The lads can do anything at this moment in time - how we looked after each other was the most impressive thing.
"If we get any more injuries in the week we might have to have a look at Old Belvedere under 12s. We'll lick our wounds and go again. England will be dangerous, but it'll be one hell of a weekend on St Patrick's Day."
Scotland: Hogg; Steyn, Jones, Tuipulotu, Van der Merwe; Russell, White; Schoeman, Turner, Z. Fagerson, R. Gray, J Gray, M. Fagerson, Ritchie (capt), Dempsey.
Replacements: Brown, Bhatti, Berghan, Cummings, Watson, Price, Kinghorn, Harris.
Ireland: Keenan; Hansen, Ringrose, Aki, Lowe; Sexton (capt), Murray; Porter, Sheehan, Furlong, Henderson, Ryan, O'Mahony, Van der Flier, Doris.
Replacements: Kelleher, Healy, O'Toole, Baird, Conan, Jamison-Park, Bryne, Henshaw.
Referee: Luke Pearce (Eng)