Washington won its fifth in a row and handed the Giants their third straight setback.
The Nationals took a 6-1 lead with their big inning, during which they scored a run on a wild pitch and another on a throwing error by third baseman Pablo Sandoval. The first two runs in the inning were scored by Bryce Harper and Jayson Werth on Rendon's double to center.
San Francisco managed only one run on six hits during a seven-inning effort by winning pitcher Jordan Zimmerman (14-6).
The Giants, however, came up with a solo homer by Brandon Belt and a two-run double by Sandoval in the eighth to get back in the contest.
Belt singled in another run in the ninth off Rafael Soriano and the Giants eventually put runners on first and second with two away. Soriano, however, got Hunter Pence on a fly ball to center that ended the game and gave the Washington closer his 31st save.
Tim Lincecum (6-12) gave up six runs on seven hits in six innings to take the loss.