Huff then coaxed a base on balls from John Lannan (2-3), giving San Francisco a 2-1 lead and helping the Giants even their four-game set with Washington at one win apiece.
The victory went to Guillermo Mota (2-0) and Brian Wilson earned his eighth save despite a rocky ninth in which he issued a pair of walks and hit Jayson Werth with a pitch but struck out Adam LaRoche to end the game.
Lannan yielded both Giants runs in a 6 2/3-inning start, allowing six hits.
Rick Ankiel drove in the Nats' only run.
Celebrity Breakups and divorces of 2014 [PHOTOS]