Marcus Thornton also added 16 points for Georgia, and J.J. Frazier added 11.
Riley LaChance scored 21 points for Vanderbilt (11-5, 1-2), and Damian Jones added 10.
Georgia never trailed after scoring the first seven points. But the Bulldogs went cold after Gaines' 3 with 5:53 left put them up 61-50, and Vanderbilt pulled within 63-61 with 28.4 seconds left on a 3-pointer by LaChance. Charles Mann hit a pair of free throws, then J.J. Frazier hit five of his six attempts to seal the win.
Gaines finished hitting 5 of 7 from 3-point range as the Bulldogs finished with a season-high 10 3-pointers. They shot better beyond the arc (10 of 17) for 58.8 percent than inside where they shot 48.9 percent (22 of 45).
But the Commodores outrebounded Georgia 36-27 to help them stay close and overcome cold shooting early as they hit only three of their first 12 shots. Only LaChance, scoring nine of his points in the first half, kept Georgia from running away early, and the freshman hit all three of his 3s in the final 28.4 seconds to keep it close late.
Luke Kornet finally hit Vanderbilt's 10th 3-point attempt with 42 seconds left, but Georgia took a 31-22 lead into halftime.
Gaines opened the second half hitting a 3, then followed with a dunk giving the Bulldogs their biggest lead yet at 35-22. But they couldn't push the lead past 14 points.
The Commodores stayed close with an occasional 3-pointer, and Wade Baldwin IV hit their fourth of the second half followed by a bucket by Jones to pull within 58-50 with 6:23 left. Gaines simply answered with his fifth 3 of the game.
Georgia didn't hit another shot from the floor, setting up a frantic final minute.