Updated

Ryan Zimmerman singled in two of Washington's five runs in the fifth inning, and the Nationals rallied to beat the sloppy Arizona Diamondbacks 6-5 on Saturday night, stretching their season-best winning streak to eight games.

Jason Werth and Michael Morse each had an RBI double in Washington's big inning, which was aided by two Arizona errors and a wild pitch from Diamondbacks starter Wade Miley (12-8).

Aaron Hill homered and Justin Upton doubled twice for the Diamondbacks, losers of the first two of the series and six of eight overall.

Edwin Jackson (7-7) got the win despite giving up five runs and eight hits in 5 2-3 innings.

Tyler Clippard threw a perfect ninth for his 24th save in 28 tries.

The Nationals, with a major league-best 71-43 record, stayed 4 1-2 games ahead of Atlanta in the NL East. Arizona dropped five games behind first-place San Francisco in the NL West.

Miley went 4 1-3 innings, his shortest outing since June 30, and gave up six runs — four earned — and nine hits.

The rookie left-hander was cruising with a 4-1 lead when things fell apart.

Steve Lombardozzi led off the fifth with a bunt single, took second on Jackson's sacrifice bunt, and scored when Werth doubled to right. Third baseman Chris Johnson couldn't handle Espinosa's sharp grounder, the ball careening off his glove into the outfield grass for an error that left runners at second and third. Zimmerman followed with a single that brought home both runners to tie the game 4-4. Zimmerman took second on a wild pitch, then advanced to third on the play when the catcher Montero threw wildly past second.

Morse's double brought in Zimmerman to put the Nationals ahead 5-4. Miley walked Adam LaRoche and was finished for the night, but the Nationals weren't.

Brad Bergeson got Tyler Moore to line out to center, but Jesus Flores singled in Morse to boost the lead to 6-4. Two of Washington's runs in the inning were unearned.

Arizona cut it to 6-5 in the sixth when Gerardo Parra singled with one out and scored on Ryan Wheeler's pinch-hit double off the center field wall.

While Washington had just one base runner, on a walk, in the final four innings, the Diamondbacks threatened in the seventh and eighth.

Hill led off the seventh with a double but Kubel struck out, then Paul Goldschmidt and Upton grounded out. Washington reliever Michael Gonzalez walked two of the first three he faced in the eighth. But pinch hitter Jake Elmore flied out in his major league debut, then Drew struck out.

Each team scored in the first.

Danny Espinosa singled with one out for the Nationals, and Zimmerman doubled to right field, where Upton bobbled the ball, allowing Espinosa to score.

After Hill's one-out homer in the first tied it, Arizona broke ahead in the second. Upton led off with a double and scored when Montero tripled past Werth in center. Montero scored on Drew's two-out single to make it 3-1. The Diamondbacks got another in the third. Kubel led off with a single, advanced to third on Upton's second double of the evening and scored on Johnson's sacrifice fly.

Notes: The Nationals improved to 39-21 on the road, by far the best in the majors. ... With LHP Mike Zagurski designated for assignment on Saturday, Arizona has no left-hander in the bullpen. ... A serious dust storm swept through downtown Phoenix during the game, some sifting through the cracks of Chase Field. ... Washington improved to 10-2 in August, best in the majors. ... Miley is 3-4 in his last seven starts. ... A pair of left-handers go in the series finale on Sunday, rookie Patrick Corbin (3-4, 3.53 ERA) for Arizona, and Ross Detwiler (6-4, 2.99) taking the mound for the Nationals.