A distant seven strokes off the pace going into the final round of the penultimate Fall Series event, American Gainey flirted with golf's magical number of 59 as he posted a 16-under total of 264.
The 37-year-old, who had recorded just one top-10 in his previous 30 starts on the 2012 US Tour, piled up eight birdies and an eagle to finish a stroke in front of compatriot David Toms (63).
Jim Furyk, co-leader overnight with United States Ryder Cup captain Davis Love III, needed a birdie at the par-four last to force a play-off but he bogeyed the hole for a 69 to finish alone in third place at 14 under.
Tournament host Love was a further two strokes back after closing with a 71, level with compatriot D.J. Trahan (69) and Zimbabwe's Brendon de Jonge (65).
"I had a hot putter today," a beaming Gainey told Golf Channel after earning the winner's cheque for $720,000 and a two-year exemption on the US Tour. "It's been a hard year for me and finally we got it right.
"I was just trying to hit fairways, trying to take it one shot at a time - that old cliche. I hit fairways, I hit greens and my putter saved me," he added, after totalling only 24 putts in the final round.
Gainey, whose previous best finish on the US Tour was a runner-up spot at the 2008 Disney Classic, raised expectations of a stunning 59 after covering the outward nine in a flawless four-under 31.
He birdied the 11th, 13th, and 14th, then holed out from a greenside bunker to eagle the 15th before picking up his 10th shot of the day at the par-four 16th where he sank a 20-foot putt.
A remarkable 10 under for his round at that point, Gainey was unable to go lower as he missed long-range birdie attempts from 44 feet at the 17th and from 19 feet at the last, where his ball slid past the right edge of the cup.
"The last couple of holes I started getting a little nervous because I didn't realise I was 10 under until I looked at the board after that eagle," said Gainey, who is nicknamed 'Two Gloves' for wearing black gloves on both hands when he plays.
"You got Jim Furyk out there, you got David Toms out there, you got Davis Love III out there. You got so many future Hall-of-Famers and Hall-of-Famers that's chasing me
"But I found a hot putter today ... so I'm real happy with the way it ended up today," added the American, who has an unusual baseball-style swing.
None of Gainey's closest challengers was able to match his 72-hole total.
Toms finished a stroke back after covering the back nine in four-under 31 and Furyk, who needed to birdie the last, pushed his eight-iron approach there from the middle of the fairway well right of the green.
"What I'm most disappointed about is when it came down the stretch, hitting the ball pretty much as good as I can, I made really, really poor swings at 17 and 18 with a 7-iron and 8-iron," Furyk said.
"So to play those two holes and not get one good look at it for birdie was disappointing."
The US Tour veteran had been bidding for his 17th victory on the US circuit after a 2012 campaign of golfing heartache.
Furyk lost to Luke Donald in a play-off at the Transitions Championship, blew a late lead at the US Open to Webb Simpson and coughed up a hefty final-hole lead at the WGC Bridgestone Invitational to Keegan Bradley.
"I played a solid round of golf," the 42-year-old American said. "I had a really good ball-striking week to where I made two bogeys this week. Unfortunately one of them was on the last hole.
"I had my looks, I had my chances. The putts I made were usually for par. I didn't make a lot of birdie putts today, and down the stretch I needed to hit a couple better iron shots.
"But 10-under-par, my hat's off to him (Gainey). It was a good round."
- Jim Furyk
- David Toms