PITTSBURGH (AP) -- The Washington Nationals' anemic offense found a way to come to life when they needed it most.
"We been lacking the power pretty much the whole season so to see them come in bunches today, that's a good sign," said Washington manager Manny Acta, whose team had scored only six runs in their past four games and eight total runs in their previous eight defeats.
Pittsburgh's Matt Capps (0-1) had been 15-for-15 in save opportunities and appeared headed to his third save in as many days when he got two quick outs to open the ninth. But on successive pitches Elijah Dukes doubled to right and Milledge homered to left.
"We all know that Capps is an aggressive guy, and Dukes and I are aggressive hitters, so we were trying to get to him early in the count," Milledge said. "We knew we were going to get that fastball and that's what we were looking for, and both of us got it."
Entering the game, the Nationals were last in the National League in both runs and homers and were 1-31 when trailing after six innings. They were winless in 35 games when behind heading into the ninth. The Pirates hadn't lost a game all season when leading at any point after the sixth.
"They beat me tonight," Capps said. "I felt like I had good stuff tonight. They just beat me."
"We just had some guys step today," Milledge said. "It seemed like everybody wanted to be that leader, that guy that everybody kind of jumps on and rides. We had about four guys that really wanted to get the job done today and fight to win. And when you have that, you can't expect nothing but good results."
Ryan Doumit went 4-for-4 with two home runs, three runs and three RBIs for the Pirates.
Young, Flores and Belliard hit solo homers in the seventh -- the latter two in succession against Pirates starter Paul Maholm to make it 5-4.
That came after he faced only three above the minimum through six. Maholm gave up four runs and 10 hits with no walks and four strikeouts in 6 2/3 innings.
"For the first six innings, I cruised," Maholm said. "They were hitting the ball on the ground. I was keeping the ball down. In the seventh, for some reason they started hitting everything I threw out [of the park]."
The Nationals fell behind early when Doumit capped a three-run first inning for the Pirates with his blast to right against Washington starter Tim Redding with Bay aboard. Earlier in the inning, Nate McLouth scored on Freddy Sanchez's groundout.
All Redding would allow through the remainder of his six innings was Doumit's seventh homer, a solo shot in the sixth. Redding was charged with four runs and eight hits, walking one and striking out three.
It was the second multihomer game of the year for Doumit, who had been only 1-for-12 since coming off the disabled list.
Belliard, who had been 0-for-15 in four games on a rehabilitation assignment in Double-A and Single-A, homered to left with two outs in the fifth.
The start of the game was delayed 10 minutes by threatening skies. Belliard was the second National to homer twice in a game this year, matching the feat of Ryan Zimmerman May 7 at Houston. The only other time Washington players hit consecutive homers this season was April 29 against Atlanta when Zimmerman and Nick Johnson did it. It was the third four-hit game of Doumit's career. ... The last time the Nationals hit five homers in a game was May 9, 2006, at Cincinnati.