The 41-year-old had not won on the PGA Tour since 2009 but he managed to get the better of Sweden's David Lingmerth and compatriot Charles Howell III at the second hole of a three-man play-off.
Scott Stallings began the final day with a five-shot lead but was unable to hit the heights of his previous rounds, with a two-under par 70 leaving him in a tie for fourth with James Hahn on 24-under par.
Gay's incredible nine-under par 63 saw him reach -25, and that total was matched by Howell's 64 and Lingmerth's sensational 10-under par 62.
The top three then headed down the 18th once again to try to determine the winner, with Lingmerth eliminated after carding a six at the first extra hole.
The remaining two players then tackled the 10th and it was advantage Gay off the tee with an excellent drive right down the fairway.
Howell could only find the rough and put his second shot in the sand, before taking a further three shots to get down.
Gay put his second to within five feet of the hole and had two putts for victory, but only needed one to record his fourth PGA success in a 19-year professional career.
Despite his advancing years, the Texas-born star confessed that winning a tournament still leaves him dizzy.
"It feels amazing right now. I'm still in a little bit of shock," he said. "It kind of happened so fast there at the end the way things went down."