Enya Breen converted her own try in the last act of the game to give Ireland a dramatic win and condemn Scotland to the Women's Six Nations Wooden Spoon.
In a reverse of the last meeting between the sides - when Scotland scored at the death to end Ireland's World Cup qualification hopes - the visitors looked set for a win.
They led as the clock ticked into the red thanks largely to a dominant third quarter, but Ireland's relentless pressure finally told as Breen surged over before landing the crucial kick.
It appeared that Scotland had done enough to claim their first victory of the tournament and leave Ireland sitting bottom of the table in head coach Greg McWilliams' first campaign at the helm.
Helen Nelson's three second-half penalties gave them a six-point lead after player of the match Neve Jones had put Ireland in front just before half-time.
Vital win in Ireland's quest to turn page
In their first campaign under McWilliams, Ireland were determined to use the Six Nations to mark the beginning of a new chapter after a torrid 2021 that came to a head - at least on the pitch - in a defeat by Scotland that ended their hopes reaching the World Cup.
With one win from their opening four, the result of the final game in Belfast would bear huge significance for a side seeking early momentum in their rebuild.
Despite this, it was Scotland who started far brighter as they went about trying to establish dominance in what would prove to be a ferociously contested breakdown battle.
Christine Belisle won the first penalty allowing the visitors to kick to the corner and maul to within an inch of the Irish line. Ireland's defence initially repelled Scotland's efforts but eventually Gallagher powered over for the opening score.
Conditions made life exceedingly difficult for both sides who struggled to keep ball in hand, although eventually Ireland moved through the gears buoyed by an unrelenting home support.
Hannah O'Connor's long distance penalty put them on the scoreboard before magnificent, hard-hitting defence - led by front rows Jones and Linda Djougang - pushed Scotland back to further shift the momentum.
The home try arrived just a minute before half-time, with Jones touching down at the back of a maul that drove all of 10 metres to reach the whitewash.
Dogged Scottish defence inches away from sealing win
The first 20 minutes of the second half looked to be the game's decisive period as Scotland took control in territory and possession while Ireland struggled to keep a lid on their penalty count.
As the infringements rose, Nelson took advantage with three penalties to move her side into the biggest lead of the night.
Ireland by contrast looked to have lost their way in attack, unable to find the edge with their short lines asking few questions of the Scottish defence.
With 10 minutes left, they finally carved out a penalty in the Scottish half and, having initially looked to have opted for a kick at goal, sent the ball to the corner.
It would prove a smart decision, as for the remainder of the game they remained almost exclusively inside the 22.
They came close to finding the vital score on several occasions but Scotland's defence refused to buckle - with Emma Orr racing back to beat Jones to a ball bouncing in the in-goal area after the Irish hooker had charged down an attempted clearance.
In their final role of the dice, Ireland put together their most accurate attacking set of the day to keep ball in hand before finding Breen, who put here head down and bulldozed through a tackle and over the line to spark joyous scenes on the terraces.
There was still the all-important conversion to come and with her team standing behind, Breen sent the kick between the posts.
Ireland: Irwin; Doyle, Naoupu, Breen, Scuffil-McCabe; Caughey, Dane; Djougang, Jones, Haney, Fryday (capt), Monaghan, Wall, McMahon, O'Connor.
Replacements: Hooban, Pearse, O'Dwyer, McDermott, Moore, Og O'Leary, Hughes, Claffey.
Scotland: Rollie; Lloyd, Thomson, Nelson, Campbell, Law, Mattinson; Wright, Skeldon, Belisle, Wassell, Bonar, Malcolm, McLachlan, Gallagher.
Replacements: Rettie, Bartlett, Dougan, McMillan, Donaldson, McDonald, Orr, Gaffney.