Gainey, known for wearing two black gloves while playing, finished at 11-under 277 after beginning the final round two shots behind overnight leader Robert Streb.
'I was looking at the scoreboard and I knew I needed the putt to win,' said Gainey, who last month claimed his first PGA Tour win at the McCladrey Classic with a final-round 60. 'I was glad it went in.'
Triplett, the second-round co-leader, finished with a 68. McGirt, three shots off the lead after the third round, shot 69 in the finale of a tournament that features players from the PGA, LPGA, Champions and Web.com tours.
McGirt and Triplett, playing one group ahead of Gainey, both missed birdie attempts on the 18th to move to 11 under.
'I figured if I got to 10 under, I'd have a chance to win,' said Triplett, who in July claimed his first Champions Tour victory at the First Tee Open at Pebble Beach.
Gainey, who earlier this season placed third at Crowne Plaza Invitational, hit his second shot on the par-5 18th into the left bunker. But he smoothly placed his third shot in position for the winning birdie.
'I am pretty good bunker player,' said Gainey, who earned $60,000 of the $300,000 purse. 'You can't ask for more than winning at Pebble Beach.'
Billy Horschel, who finished with a 72, was alone at 9 under.
Tommy Armour III, who won the tournament in 2007 and 2008, finished at 8 under after a 70.
Streb moved to 13 under after four holes and held a three-shot margin over Gainey. But Streb quickly faltered, finished with a 76 and was grouped with Bryce Molder (68), John Cook (71) and James Hahn (73) at 6 under.
Hall of Famer Annika Sorenstam, playing in a foursome that included Juli Inkster, shot a 69 and finished at 1 over.
'For me, there's just rust and not playing often,' said Sorenstem, whose 289 total included an 81 at Spyglass Hill on Saturday. 'That's when you notice the biggest difference.'
Sorenstam, a 10-time major winner who retired from the LPGA in 2008, has played in only a few competitive tournaments since, including the Pebble Beach Invitational three times.
Inkster, who in 1990 edged Mark Brooks and became the only female winner in tournament history, had a final-round 71 and finished 3 over.
Trevor Immelman withdrew on the third hole of the final round with an undisclosed injury, and Charlie Wi withdrew prior to the final round because of illness.