PITTSBURGH -- The D-backs wasted another sterling outing from right-hander Daniel Hudson as the Pirates rallied for a 4-3 victory and a three-game series sweep on Sunday afternoon at PNC Park.

Right-hander Aaron Heilman was victimized for three eighth-inning runs and took the loss, falling to 5-8. Ronny Cedeno led off with a swinging bunt single, Andrew McCutchen singled and Cedeno came in to score on a fielder's-choice bad-hop groundout by Jose Tabata. Neil Walker then smacked his 12th home run of the season to lift the Pirates.

Heilman was disappointed with the way the inning unfolded.

"The swinging bunt to lead off the inning -- I make a couple good pitches here and there and get a bad hop, and [third baseman Mark] Reynolds does a great job even getting a glove on [Tabata's grounder], let alone getting an out," Heilman said. "Two outs, and it wasn't a pitch where I wanted it. It was down, but it was still over the plate and Walker beat me to the spot."

"We've had a tough road trip, and we've wasted several efforts, especially two of them here," D-backs manager Kirk Gibson said. "Hudson threw the ball as good as he has for us since he's been here, and it's tough.

"We put ourselves in a bad situation there. Heilman wasn't commanding the ball there, bad counts and a bit of bad luck. And then the double-play ball to Reynolds that took a bad hop. It was just a tailor-made double-play ball, and he did a great job to get an out out of it. It was unfortunate, but still, you've got to pitch out of that stuff. That was the story of the game."

Walker was excited by the comeback and his clutch hit.

"Just hit the ball, really," Walker said with a laugh. "I knew Tabata was going to get at least one in there, and fortunately, he kept himself on base there, hustled down the line. I got myself in a good hitter's count and was able to do something with it.

"You try not to think about that too much, but at the same time, you certainly don't want to be the guy that ends the inning. That certainly wasn't my mindset at the plate; my mindset was to get a pitch to drive. I was thinking to just try to hit one in the gap somewhere and possibly get a chance to score Jose. Instead, I was fortunate enough to get one in the air and hit one on the barrel."

Gibson said he isn't second-guessing the decision to stick with Heilman.

"Aaron has been good, and he's actually better against lefties," Gibson said. "Obviously, you think about turning Walker around, but there's a guy on and he's got two outs. That was the decision we made, and you can second-guess if you want, but you've got to make pitches and you've got to get ahead in the count. You get in bad counts, and bad things happen."

Hudson was on a roll coming into the contest, going 6-1 with a 1.67 ERA in his previous nine starts with Arizona since joining the D-backs from the White Sox in the July 30 trade for right-hander Edwin Jackson.

Hudson went 6 1/3 innings in this one, allowing one run on McCutchen's leadoff homer in the first, one of three hits Hudson allowed on the day. He recorded six strikeouts and received a no-decision.

"[McCutchen] jumped on a first-pitch fastball, and that's nothing to hang your head about," Hudson stated. "You've just got to go out there and get a couple guys out and put a couple zeros up after that. I was just throwing a lot of strikes and moving my fastball in and out. [I] threw some changeups in some hitter's counts and kept them off-balance a little bit. I was nibbling a little bit and got my pitch count up a little bit. I just tried to give us a chance to win."

It was the second leadoff home run of the season for McCutchen and the sixth of his career.

"First pitch of the game, I throw a strike. It happens in a lot of games, and McCutchen just jumped on it and crushed it," Hudson said. "I told myself, 'All right, I got something for you next at-bat,' but he just put a good swing on it."

The Pirates got a solid start from lefty Zach Duke, who hurled 7 1/3 innings and gave up three runs on six hits. Duke had been shelled in his first three September starts, allowing 15 earned runs in 9 1/3 innings. He wound up with a no-decision.

"Duke was kind of keeping guys off-balance," D-backs catcher John Hester said. "He had a good two-seamer working and was getting guys out front with that, and that little cutter curveball was getting lefties off-balance, too. He did a good job of slowing us down and speeding us up and going in and out, too."

The D-backs broke through against Duke in the top of the fourth inning. Chris Young walked and advanced to second on a groundout. Young scored on an RBI double by Adam LaRoche. With two outs, Hester doubled in LaRoche, giving the D-backs a 2-1 lead.

Arizona upped the lead to 3-1 in the top of the eighth inning, as Ryan Roberts cracked a solo home run, his second round-tripper of the season.

"I wasn't comfortable; you've got to add as many runs as you can," Gibson said. "In a game, you don't relax until the last out, and today is proof why you don't do that."

Joel Hanrahan notched the win in relief for the Pirates, upping his record to 4-1, and Evan Meek picked up his third save of he season.