'It's a dream come true,' said the Scot. 'To win my first title here at St. Andrews is fantastic.'
Gallacher battled with McDowell down the stretch before both players found trouble with bogeys on the difficult par-4 17th on the Old Course at St. Andrews. Closing pars left the duo knotted at 19-under-par 269 leading to the second playoff in tournament history.
Back on the first hole, Gallacher hit a brilliant approach that rolled 2 feet past the hole. McDowell was not as fortunate, however, and left his second shot in the stream protecting the putting surface.
'When Stephen stiffed it in the playoff, it forced me into trying to get too cute with it,' McDowell said. 'Normally I would have just flown it over the pin.'
McDowell took a drop but was unable to chip in for par. Gallacher had two putts for the win, but he calmly sank the birdie putt to take the title in style.
Gallacher was three shots behind Luke Donald to start the day, but made moves early with a long birdie putt at the fourth. He nearly eagled the fifth, but walked away with another birdie and grabbed a share of the lead a few holes later with a birdie at the seventh.
Donald clawed back and hit his second to 5 feet for a birdie at the seventh to regain the outright lead. That advantage proved to be short-lived, however, and Gallacher moved back into a tie for first with a birdie at the 10th.
Gallacher then took sole possession of the lead with a birdie at the 12th, but McDowell converted a 16-foot putt for a birdie at the very next hole to join him atop the leaderboard.
Gallacher tried to pull away again with a birdie at the 13th to reach 20 under, but McDowell reached the par-5 14th in two en route to a birdie of his own.
At the par-4 17th, Gallacher hit his tee shot in the rough and was only able to advance his ball down the fairway. He played his third to 20 feet but was unable to save par.
In almost identical fashion, McDowell went through the fairway into the rough, although his ball stopped before the grass got too thick. McDowell left his second shot just short of the green and chose to putt over the slope, leaving himself with an 18-footer to save par.
McDowell walked away with bogey on his way to a round of 68.
Gallacher was one better than McDowell on the final day with a 5-under 67 for the biggest win of his career.
Ian Poulter landed his approach to the 18th within 2 feet of the hole and tapped in for birdie and a round of 69. He was joined at 18-under-par 270 with Donald, who carded a 71 in the final round.
'I played okay today, not great,' said Donald. 'I had a lot of chances for birdies and just couldn't quite get the putts in and a couple of bogeys coming in. But I stuck in there hard and gave it a go.'
Lee Westwood tried to come back to become the first back-to-back winner of this event, but he finished three shots off the lead despite a final-round 67. David Howell double bogeyed the 17th to finish alongside Westwood at 16-under-par 272.
Fred Couples and Ernie Els shared seventh place at 14-under-par 274. Nick O'Hern, Richard Green and Marcel Siem followed at 13-under-par 275.