PHOENIX -- Trailing by a run and behind 0-2 in the count to Brewers ace Zack Greinke with runners on the corners and one out, John McDonald was one swing away from wasting another scoring chance for the inopportune of late D-backs offense.The club had already squandered two such opportunities earlier in the game with strikeouts and a baserunning error. Instead, the veteran infielder used his remaining swing to pull his team out of the mire with a three-run homer into the first row of the left-field bleachers. Behind McDonald's power, the D-backs smashed out 15 hits and batted around in the third inning to rally from a three-run deficit to an 8-5 victory over the Brewers on Saturday at Chase Field. "I didn't look too good on the first two pitches," McDonald said. "I was lucky enough to get a breaking ball that wasn't down and put a good swing on it." D-backs lefty Wade Miley bounced back from a rough start to his outing, lasting six innings and allowing five runs (three earned) on eight hits to secure his team-leading sixth win of the season. "It's a team win, offense battled and picked me up when I was struggling," Miley said. "I wanted to go deep to help out the team. It was a confidence thing. I knew my job went to trying to lock it down." Even though 25-year-old didn't have his best stuff, the D-backs were going to ride him for as long as they could to help save the bullpen. "We needed the innings tonight. He was going to go over 100 pitches," D-backs manager Kirk Gibson said. "He's got game, and he doesn't have a care in the world. He handled the pressure very well tonight. He had a bad inning and composed himself afterwards." With a base knock in the third and a double in the fifth, Miley complemented his pitching performance by extending his hitting streak to seven games, tying the franchise record for a pitcher set by Dan Haren in 2010. "I don't think we're all that surprised right now. He's not just putting the ball in play, he's making hard contact," McDonald said. "When Wade's hitting behind me, they are definitely not going to walk me. It's nice. We have some pitchers that can definitely swing the bat." Miley's double came on a swing he was well out in front of that nearly left the yard, falling just shy on the right-field wall. "I 100 percent thought it was a popup," he said. "I looked up and didn't know where it was and I saw the outfielder running back. I blacked out and started running." Greinke lasted just 2 1/3 innings, allowing seven runs on 10 hits and three walks. The 28-year-old gave up eight runs to the Cubs on April 12, but had not surrendered more than three in an outing since. "I was trying to be better than I could really pitch," Greinke said. "That's the main thing -- I got out of my normal game plan. ... I tried to get out of it by throwing harder, and throwing better sliders." With the score at 2-1 entering the third inning, Cody Ransom, waived by the D-backs on Monday and picked up by the Brewers on Wednesday, doubled to drive in two runs after one had already crossed the plate. A throwing error from third baseman Ryan Roberts allowed the fourth run of the inning to score, putting the Brewers up, 5-2. Back on their heels, the D-backs' first four batters of the third inning reached via a single or walk. After Konrad Schmidt grounded out to drive in a run, his first in the Majors, McDonald delivered his clutch homer off Greinke to put his team ahead for good, 7-5. "It was great, coming back after they scored in the top of inning," McDonald said. "That's something we haven't done a whole lot of. It was definitely a positive." Brad Ziegler, David Hernandez and J.J. Putz all worked perfect innings to close out the game. Saturday was Putz's bobblehead night at Chase Field. "To watch our bullpen pitch the way they did," McDonald said, "that reminded a lot of people of what we're capable of doing and what we need to do to be success for this year."