Sexton’s understudy Carbery so nearly fluffed his lines when throwing an intercept pass to Finn Russell, who raced on and popped off the ground for Johnson to score.
But the 23-year-old Carbery quickly found his place in the script, wriggling free and lofting out a fine pass for Earls to score the winning try.
Scotland lost Lions full-back Stuart Hogg to a shoulder injury, with Gregor Townsend’s men unable to add enough industry to their impressive finesse.
Ireland failed to convince for long stretches in their search for a riposte following last weekend’s punishing 32-20 home loss to England.
Scrum-half Murray again struggled with his kicking out of hand, and Sexton only lasted 24 minutes before being withdrawn, with Scotland constantly targeting him physically.
Schmidt’s men found the route to victory however, and having been so shaken and bullied by England last week, he will take this win any which way.
Ireland tiptoed to half-time with an unconvincing 12-10 lead, somehow fending off strong Scotland pressure.
Murray’s poor kicking and further inaccuracy gifted Scotland plenty of territory and possession, with Russell a constant threat on the ball.
Laidlaw slotted a penalty to put Scotland first on the board, only for Ireland to strike back through huge fortune.
Tommy Seymour should have comfortably dealt with Stockdale’s chip over the top, but instead flung a wild pass that eluded the helpless Sean Maitland.
Murray nipped onto the loose ball and scooted across the line, but curiously the half-back did not dot down under the posts.
Sexton duly missed the conversion, but Ireland eased those frustrations with another quick-fire score.
Peter O’Mahony’s midfield switch with Sexton opened the door for an inside ball to Stockdale, and the Ulster winger screamed home in style.
Murray slotted the conversion, as the big hits started to take their toll on Sexton, for Ireland to lead 12-3.
Just when Ireland looked to kick on though, further errors invited Scotland back into the contest.
Sexton was forced to admit defeat in his battle to stay in the game, trotting off with a bloodied nose and facial injury.
His replacement Carbery looked to have settled quickly, but then threw a wild interception pass that Russell gobbled up and hared towards the line.
Earls hunted down Russell in style, but the Racing 92 fly-half kept his cool and popped off the ground to the onrushing Johnson, who finished neatly.
Laidlaw’s conversion had Scotland trailing by just two points, and Ireland’s panic set in.
Another poor Murray box kick gifted the hosts the ball, Carbery fumbled rather than collected and Earls had to sweep and roll into touch just five metres out.
Ireland disrupted the line-out but Rory Best had to touch down over his own line under pressure from Stuart McInally.
Scotland twice fended off the visitors to open the second half, only to concede a poor score.
Carbery wriggled through heavy midfield traffic, arced wide and floated a fine pass out to Earls, who nipped home.
Munster pivot Carbery slotted the conversion for Ireland to lead 19-10 approaching the hour.
Laidlaw and Carbery exchanged penalties as Ireland maintained that nine-point advantage, and so it stayed, leaving Ireland mightily relieved to head home with the win.
Press Association Sport
Sign up to our mailing list here and we’ll keep you up to the minute with weekly updates from the world of rugby.