PITTSBURGH -- For the first five innings Thursday night, it certainly did not look good for the D-backs.
Pirates right-hander Vance Worley was throwing a no-hitter, and Arizona was already down a couple of runs.
After a gut-wrenching loss Tuesday, a rare lackluster effort Wednesday and a huge deficit in the standings, it seemed easy for the D-backs to check out of this game.
That all changed in the span of four batters in the sixth as the D-backs rallied to take the lead before running away with a 10-2 victory to avoid a sweep at PNC Park.
"This has been a bad year, and the first two games we lost games in two different ways, and it's certainly one where you can go out the third night and roll over, especially early on when you have a pitcher shutting you down," D-backs starter Brandon McCarthy said. "But that doesn't really exist on this team. It's a bunch of guys that care and are very professional. They're good with the younger guys, and you see the fight keep happening, which is really all you can ask for at this point."
The game turned for Worley when he walked Didi Gregorius to open the sixth.
Pitcher Brandon McCarthy sacrificed Gregorius to second, and Ender Inciarte followed with a bloop single to left. It was the D-backs' first hit of the game, and it brought home Gregorius to cut the Pittsburgh lead to 2-1.
Worley fell behind David Peralta, 2-0, and then hung a curveball that Peralta smacked over the wall in right, and suddenly the D-backs led by 3-2.
"The first at-bat I got a strikeout; I was just thinking too much," Peralta said. "Second at-bat I grounded out, and I was like, 'OK, I'm going to get it next time.' So next time he gave me a pitch I wanted, and I put a good swing and got a home run."
The D-backs erased any evidence of the early drought in a seven-run ninth, with five runs off Ernesto Frieri and another two against Jeanmar Gomez.
The 10 runs equaled their total over their previous six games, and it seemed that once the dam broke the hitters relaxed and the hits flowed easily.
"The first day was devastating, I mean they came back and stole that game from us," D-backs manager Kirk Gibson said of the series-opening 3-2 walk-off loss. "We had our worst game of the year last night, so just to come back today and just the attitude they had the way that played a clean game, aggressive everywhere, no errors, played good behind all their pitchers."
McCarthy (3-10) won for the second straight start as he managed to go 5 2/3 innings while scattering eight hits and allowing two runs.
"I really like the way we worked him," Pirates manager Clint Hurdle said. "We pushed his pitch count to a very good place. He threw strikes, he always does, kept the ball down with some angle. We threw what we had at him, and it wasn't enough."
Gregory Polanco drove home the Pirates' first run of the game when his groundout to short scored Jordy Mercer from third in the third inning.
One inning later Ike Davis singled home Neil Walker to give the Pirates a 2-0 lead.
"Overall, I felt fairly sharp," McCarthy said. "I just didn't feel terribly fresh. You get that in some starts. Some starts you come out and you feel great out of the gates. Some games you're fighting through. Today was a little bit of a fight. I felt like I managed to keep pace well, and even when things got a little dicey I kept trying to make pitches and let things work out."
Reliever Oliver Perez picked up the final out of the sixth, Evan Marshall retired the side in order in the seventh, Brad Ziegler pitched a scoreless eighth and Matt Stites closed out the ninth.
Steve Gilbert is a reporter for MLB.com. Read his blog, Inside the D-backs, and follow him on Twitter @SteveGilbertMLB. This story was not subject to the approval of Major League Baseball or its clubs.