Updated

The Washington Nationals were able to string six hits together against Brett Anderson and come up with a five-run rally that blew the game open.

The Los Angeles Dodgers got seven hits against Gio Gonzalez, but couldn't get the timely one.

Gonzalez pitched eight scoreless innings, Ian Desmond hit two homers, and the Nationals opened a 10-game trip with an 8-3 victory over the NL West-leading Dodgers on Monday night.

The left-hander struck out six, walked one and stranded eight runners, helping the Nationals remain 1½ games behind the NL East-leading New York Mets.

Gonzalez (9-4), who won 21 games for Washington in 2012 after coming over from Oakland in a trade, is 5-0 with a 1.48 ERA in eight starts since losing 6-1 at Tampa Bay on June 15.

''I felt like everything I was throwing down was working,'' Gonzalez said. ''I just wanted to attack the strike zone and be real aggressive with those guys -- especially knowing that it was tough for them coming back after that late-night flight.

''I felt like they were going to be aggressive tonight, so I just tried to work the pitch count and just trying to pound the zone. I wanted to be dominant. The eight innings means a lot. It might have been the first time this year I've gone eight.''

Anderson (6-7) was charged with seven runs and 10 hits through five-plus innings in a matchup of pitchers who specialize in getting ground balls.

Carl Crawford hit a three-run shot for the Dodgers in the ninth inning off Doug Fister for the first pinch-hit homer of his career.

Los Angeles' division lead over idle San Francisco was cut to 2½ games in the opener of a seven-game homestand, which followed a three-game sweep in Pittsburgh.

Desmond gave the Nats a 2-0 lead in the second, driving a 1-0 pitch into the lower seats in the left-field corner after a leadoff double by Ryan Zimmerman. He added his 14th homer in the eighth, a leadoff shot off J.P. Howell.

None of Desmond's last 28 home runs have come with more than one man on base since his three-run shot on May 20, 2014, against Texas' Colby Lewis at Nationals Park.

''I've played with Ian for a long time, and he's a guy who's going to grind it out and play hard,'' Zimmerman said. ''That's why he's earned the respect he has around here. I don't think anybody's pulling more for him than the guys in this clubhouse.''

Anderson failed to retire any of the seven batters he faced in the Nationals' five-run sixth, which increased the lead to 7-0.

''I wasn't able to get anybody out,'' he said. ''I pride myself on giving us a chance to win, and I felt like I did that through five. But the stuff was bad. I fell behind and I made a bunch of mistakes.''

Zimmerman got the ball rolling with an RBI double. Former Dodger Jayson Werth followed with a two-run double over the head of rookie center fielder Kike Hernandez, and Michael Taylor chased the left-hander with an RBI single.

''We were able to string some things together and score some runs against a guy who's been having a good amount of success lately,'' Zimmerman said. ''He made some good pitches, but we did a good job of laying off some of those balls low in the zone and try to make him elevate the ball. His bread and butter is to get you to swing at that sinker. And the curveball gets a lot of groundballs, too.''

Dodgers second baseman Howie Kendrick was placed on the 15-day disabled list less than 24 hours after straining his left hamstring running out an infield hit. Jose Peraza, promoted from Triple-A Oklahoma City to fill the roster spot, started at second in his big-league debut and went 1 for 3 with a walk batting second.

TRAINER'S ROOM

Nationals: C Jose Lobaton played the entire game after getting hit by the backswing of Rollins' bat in the batter's box before Gonzalez threw his first pitch. It tore off the nail on his index finger.

Dodgers: 1B Adrian Gonzalez, who leads the club in homers and RBI and had experienced a stiff neck during the trip, got the night off following the long plane flight on Sunday night. ... The club voided the option of RHP Carlos Frias and returned him to the DL, retroactive to Aug. 2, with tightness in his lower back.

UP NEXT

Nationals: RHP Joe Ross (3-3, 2.80) has 47 strikeouts in 45 innings, and has pitched at least six innings in each of his last six outings. Last Thursday, he held Arizona to a run through six innings in an 8-3 win at Washington.

Dodgers: RHP Zack Greinke (11-2) gave up a season-worst six runs over six innings last Thursday at Philadelphia in a 10-8 win, raising his ERA from 1.41 to 1.71 -- which still leads the majors. It was only the second time in his last 17 starts that he allowed more than two runs.