WASHINGTON -- Pinch hitter Scott Hairston had an RBI sacrifice fly in the last of the 11th against reliever Brandon Cumpton as the Washington Nationals beat the Pittsburgh Pirates 6-5 on Sunday to sweep the three-game series.

The hit scored right fielder Jayson Werth, who led off the 11th with a double off the wall in left and went to third on a groundout.

It was the second walk-off win in as many days for the Nationals, who have now won six such contests this season at Nationals Park. Werth has been bothered by a sore shoulder the past week and has seen little action.

The first-place Nationals (69-53) won their sixth in a row while the Pirates (64-60) lost for the fifth straight game. The winning pitcher was Ross Detwiler (2-2), who threw a scoreless 10th and 11th, while Cumpton (3-4) was tagged with the loss.

The Nationals tied the game at 5 in the ninth with an RBI single by Asdrubal Cabrera after the Pirates had scored three runs in the top of the inning to take a 5-4 lead.

Pirates right fielder Gregory Polanco lined a two-run double with one out in the top of the ninth off Washington closer Rafael Soriano to cap the three-run outburst. Polanco drove the ball to right-center after a wild pitch by Soriano allowed Pittsburgh center fielder Starling Marte to score and cut the lead to 4-3.

The game featured parallel defensive breakdowns by each team, as the Pirates scored two unearned runs in the sixth only to give back three unearned runs in the seventh.

The Nationals, who trailed 2-0 going into the last of the sixth, took the lead in the seventh with the three runs.

Rookie right fielder Michael Taylor scored from third with the bases loaded on a fielder's choice and pinch-hitter Kevin Frandsen scored from second when the throw from first baseman Ike Davis got past catcher Russell Martin.

Washington center fielder Denard Span, who had singled, then scored to make it 4-2 when Pittsburgh third baseman Pedro Alvarez (two hits) made a bad throw to home on a grounder off the bat of Anthony Rendon (two hits).

The Pirates took a 2-0 lead in the sixth as Washington made two errors in the inning.

Polanco reached on an error by shortstop Ian Desmond then went to third on a hit and run single by Josh Harrison (two hits). Pittsburgh second baseman Neil Walker then hit a grounder to third and Polanco scored when Rendon made a bad throw to home for the first run.

The Pirates made it 2-0 as Martin drove in a run on an infield single to third as Rendon's throw was wide of first.

Washington cut the lead to 2-1 in the sixth on an RBI single by Desmond.

Washington starter Doug Fister allowed two unearned runs in seven innings. Pirates left fielder Travis Snider also had two hits, as did Span.

NOTES: The Pirates placed RHP Charlie Morton (5-12, 3.84) on the 15-day disabled list with right shoulder inflammation and called up INF Brent Morel from Triple-A Indianapolis. This is the third stint of the year for Morel with the Pirates. His last start was Aug. 1. ... Washington begins a series at home Monday vs. Arizona and RHP Jordan Zimmermann (8-5, 2.92) will face LHP Vidal Nuno (2-8, 4.92) of the Diamondbacks. ... The Pirates begin a series at home Monday vs. Atlanta and RHP Vance Worley (5-2, 2.51) will face Braves RHP Ervin Santana (12-6, 3.66). ... Washington C Wilson Ramos, who had the game-winning walkoff double Saturday, has four homers and 19 RBIs in his first 32 games since returning from the DL on June 26. ... Pittsburgh OF Travis Snider was 10-for-26 with three homers during a seven-game hitting streak through Saturday.