The 38 year old posted a final round one under par 71 to finish three shots clear of South African Richard Sterne, helped by a crucial eagle two "“ he holed a sand wedge from 115 yards "“ on the 16th hole.
That was his fifth eagle of the week and resulted in a three shot swing when Sterne bogeyed, returning the advantage to Gallacher, whose three shot overnight lead had been wiped out in the opening two holes.
He hung on despite the shaky start, and ultimately his 22 under par total matched the lowest in the event's history, set by Thomas BjÃƒÂ¶rn in 2001.
"These days you need to do something special to win an event, and I had the perfect distance for that wedge and it came out perfectly," Gallacher, who was runner-up here last year, said of his holed shot at the 16th. "I knew if it wasn't in it would be very close.
"It's been eight years since I last won. I'm maturing with age hopefully. The plan at the start of the year was to get into the top 50 in the world and I've practised hard and got my equipment right.
"I've come close a number of times over the years but there has always been someone else who's gone one better. I'm proud of myself to finally get there."
Sterne, who like Gallacher signed off with a 71, said: "At the start of the week you'd take second place, but having led the tournament I'm disappointed.
"On the 16th I was one shot behind and on the next hole I was four shots behind, so that took the wind out of my sails.
"But all credit to Steve "“ he played well and made some good pars and had an unbelievable birdie on the ninth. He made the right shots and the right time, which is what you have to do to win."
Englishman Lee Westwood briefly threatened the lead and a final round 68 left him tied fifth, while Dane ThorbjÃƒÂ¸rn Olesen and Chilean Felipe Aguilar shared third on 17 under.
Marcus Fraser had an outstanding week when he finished in a share of 5th position with Lee Westwood.
Stephen Gallacher "“ With This Win
"¢ His second European Tour International Schedule victory in his 404th European Tour event.
"¢ Moves to sixth in The Race to Dubai with Ã¢Â‚Â¬314,269.
"¢ Moves into the top 60 of the Official World Golf Ranking from 111th and in a very good position to qualify for the WGC "“ Accenture Match Play Championship for the first time.
"¢ His first European Tour victory since the 2004 Alfred Dunhill Links Championship, a gap of eight years and 116 days.
"¢ Played in a total of 210 European Tour events between victories.
"¢ From those 210 events played he has been second on three occasions. The events were the 2006 British Masters, 2012 Maybank Malaysian Open and tied second in the 2012 Omega Dubai Desert Classic.
"¢ Victory comes in his 13th appearance in the Omega Dubai Desert Classic.
"¢ Beats his previous best finish in the Omega Dubai Desert Classic of tied second in 2012. (Was also tied fourth on his debut in 2000 and tied tenth in 2011).
"¢ Only the second Scot to win the Omega Dubai Desert Classic after Colin Montgomerie in 1996.
"¢ Becomes the second Scot to win on the 2013 European Tour International Schedule, following Scott Jamieson, who won the Nelson Mandela Championship presented by ISPS Handa.
"¢ His first European Tour victory where he has led going into the final round. (Made up three shots in the final round to win the 2004 Alfred Dunhill Links Championship).
"¢ His winning total of 266 (-22) matches the tournament record in the Omega Dubai Desert Classic, set by Thomas BjÃƒÂ¶rn in 2001.
266 S Gallacher (Sco) 63 70 62 71,
269 R Sterne (RSA) 62 70 66 71,
271 T Olesen (Den) 67 66 67 71, F Aguilar (Chi) 68 68 66 69,
272 L Westwood (Eng) 67 71 66 68, M Fraser (Aus) 67 69 69 67,
273 R Santos (Por) 66 71 69 67, S Webster (Eng) 69 69 65 70, R Rock (Eng) 70 68 67 68,
274 J Singh (Ind) 68 67 67 72, T Fleetwood (Eng) 65 68 69 72,