WASHINGTON (AP) Clint Robinson has been taking advantage of the one chance he wanted.
The 30-year-old non-roster invitee by Washington in spring training who had just 13 major league at-bats before this season, hit a two-run homer in the seventh inning to give the Nationals a 2-1 victory over the San Francisco Giants on Friday night.
Robinson, playing first base in place of the injured Ryan Zimmerman, is 20 for 69 (.290) with four homers and 12 RBIs in his last 21 games. He had a career .302 average in 921 games in the minors before finally getting a serious shot in the majors this season after beating out veteran Mike Carp for the last spot on Washington's bench.
''There's only 750 jobs in the Major Leagues and there's thousands of guys trying to get one of them,'' Robinson said. ''It's just about being at the right place at the right time. That opportunity's going to come eventually. Mine came this year and I'm trying to make the best of it.
Robinson's homer off Jake Peavy (0-3) made a winner of left-hander Gio Gonzalez (6-4) who allowed a run and five hits in seven innings without walking a batter for the first time this year.
''He was really strong tonight,'' Nats manager Matt Williams said. ''Gio was in command of all his pitches. He was able to throw his changeups and curveballs for strikes and locate well with the fastball, too.''
Buster Posey's homer on Gonzalez's first pitch of the seventh gave San Francisco a 1-0 lead in the teams' first meeting since the Giants beat the Nats in five games in the 2014 NLDS.
''It was just finding (catcher Jose Lobaton's) glove and trying to pound it,'' Gonzalez said. ''I gassed myself up so I could keep the ball down instead of trying to amp it up and throw it hard. It was just trying to locate it and keep it down.''
Hard luck loser Peavy was nearly as good, allowing just two runs and three hits in 6 1/3 innings.
''Hard to pitch better than he did,'' Giants manager Bruce Bochy said. ''Just one mistake there. He was hitting his spots, mixing it up.''
Peavy, 34, was very encouraged by his performance in his first outing since going on the disabled list with a back injury in April.
''A lot to build on,'' he said. ''It's nice to get back in the swing of things.''
Two of the first three Nats got hits, but Peavy, who was activated earlier in the day, didn't give up another one until Robinson came through to extend the defending World Series champions' losing streak to four games.
Nats closer Drew Storen recorded his 24th save, second in the NL.
A crowd of 41,683, Washington's 10th sellout in 37 home games, watched newest Racing President Calvin Coolidge win his debut by knocking over fellow Republicans Abe Lincoln and Teddy Roosevelt.
Bryce Harper, who came in ranked in the top five in baseball in homers, RBIs, slugging percentage and on base percentage, walked in each of his first three plate appearances before he was retired with two on in the eighth by rookie left-hander Josh Osich, who was called up from Triple-A Sacramento earlier Friday.
Giants: Peavy (back) was activated from the DL in time make the start to start. He took the roster spot of fellow veteran RHP Tim Hudson (shoulder), who went on the DL.
Nationals: Williams said that injured infielders Zimmerman (plantar fasciitis) and Anthony Rendon (quadriceps) are making slow progress as they attempt to return from the DL. ... Reliever Aaron Barrett (biceps) is scheduled to make a second rehab appearance for one of Washington's minor league affiliates on Saturday.
Giants: LHP Madison Bumgarner (8-4, 2.99), the 2014 World Series MVP, was 2-2 in five starts in June, allowing 33 hits and 12 earned runs in 39 innings.
Nationals: RHP Stephen Strasburg (5-5, 5.49) has made two starts since returning from a stint on the DL with neck tightness. He allowed two runs and eight hits in 12 innings in those starts.