Battling with South African Richard Sterne for the coveted Omega Dubai Desert Classic trophy, the 38-year-old sank a 110-yard wedge from the rough at the 16th - amazingly his fifth eagle of the tournament.
With Sterne three-putting the hole just as he had the previous green, the gap between them was suddenly four shots and two closing pars saw Gallacher home by three with a 71 and tournament record-equalling 22-under-par total.
"It's taken a long time, but it's even sweeter now," the nephew of former Ryder Cup captain Bernard Gallacher told Sky Sports after a win worth almost £263,000.
His first victory came on home soil at St Andrews in the Dunhill Links Championship nine years ago and this was the 404th start of his career.
The former Walker Cup amateur - he was part of the side that beat an American side containing Tiger Woods at Royal Porthcawl in 1995 - came into the tournament 111th in the world.
But, just like last week's Qatar Masters champion Chris Wood, he should now qualify for the 64-man Accenture Match Play Championship in Arizona later this month.
And if he can make it into the top 50 by the end of next month then a debut in the US Masters at Augusta beckons for a player who just over three years ago was back at the Tour qualifying school during a struggle with sarcoidosis, a viral infection that attacked his lungs and joints.
"It's the only major I've not played," he said of the Masters. "I sit at home with the kids and watch it every year, so it would be a dream to play there."
There were so many highlights from his performance that it is hard to know where to start.
Gallacher matched his lowest Tour round with an opening 63 featuring a 175-yard seven-iron into the sixth hole for an eagle two.
He got a ball stuck up a palm tree in his second-round 70, a caddie climbing up a ladder to identify it, and then came a career-best 62 rounded off by sinking a 40-yard bunker shot for another eagle.
There was also his recovery from trouble at the ninth on the final day after he had gone from three ahead overnight to one behind.
"I had a window (between two trees) of about four feet, had to cut it and go under the first tree and over the second," he added.
"When I saw the ball two feet from the flag I couldn't believe it. That kept me going and was the catalyst to dig in on the back nine."
As for what happened on the 16th he added: "I don't really know what to say. You need that little bit of magic."
Sterne, having gone back in front with a birdie down the long 10th, let his chance slip with four bogeys in the next six holes, but hung on to take second place after his approach to the par-five last rebounded off a hospitality unit and finished on the brick wall bordering the lake in front of the green.
Minutes earlier Lee Westwood, with whom Gallacher shared second spot last year, had bounced off the bank into the water there.
The bogey six dropped the world number eight into a tie for fifth in his first start of 2013, Chile's Felipe Aguilar and Dane Thorbjorn Olesen sharing third spot.
So ended the circuit's three-week Middle East swing.
Woods and Rory McIlroy missed the cut in Abu Dhabi and left the stage for Welshman Jamie Donaldson to pick up his second victory in 268 events, Englishman Wood broke his duck in Doha and Gallacher finally tasted success again in Dubai.