Then the D-backs' lead evaporated in the seventh, and pinch-hitter Travis Hafner won it for the Yankees with a two-out, pinch-hit homer in the eighth and Miley and his teammates were left trying to explain a 4-3 loss.
"The way Wade was going, I definitely didn't see us losing this game," said reliever David Hernandez, who gave up Hafner's blast. "But that's why they play nine innings. It just kind of unraveled at the end."
How it came apart is what had Miley upset at himself as he walked off the Yankee Stadium mound.
With two outs in the seventh and a runner on first, Miley gave up a bloop double down the left-field line to Brennan Boesch.
"We got two outs and Boesch got that blooper, a jam shot, and he got a double out of it," D-backs catcher Miguel Montero said.
Miley then seemed to lose his feel for the strike zone, walking the next two hitters -- Eduardo Nunez and Jayson Nix -- to force in New York's first run.
"He was one pitch away from getting out of it, and he couldn't get it done," Montero said. "It's pretty sad, because he threw a heck of a game."
With each pitch to Nunez and Nix, you could see the frustration building in Miley. First, pitching coach Charles Nagy came out to try to calm Miley down and then Montero took his turn, but neither seemed to make a difference. Miley had faced bases-loaded jams 16 times previously in his career and had never walked a batter in that situation.
"When I walked Nunez, I was just trying to throw it 100 mph to the next guy and got frustrated and started pulling off a little bit and walked two in a row," Miley said. "They did a good job getting guys on in that seventh inning. I think I got two pretty quick outs, and then it just came unraveled. They did a good job seeing pitches, not getting overaggressive and I just kind of handed it to them."
As D-backs manager Kirk Gibson walked toward the mound to take the ball from his starter, Miley screamed into his glove, his anger directed at himself. Miley sat on the bench while reliever Tony Sipp warmed up and screamed some more into a towel and then began to tug on the threads of the towel with his teeth.
Finally, he climbed to the top step of the dugout to watch Sipp face Brett Gardner with the D-backs still ahead, 3-1.
Gardner battled Sipp before the Yankees center fielder lined a single into left that scored a pair of runs to tie the game at 3.
"I thought Wade pitched well enough to get a win right there," Sipp said. "I feel really bad. He had a good start, a quality outing. It changes with one AB. My job is to come in and get a batter out, and I didn't do my job today. It affected him, because he should have had a win right there. Instead, he gets a push."
Hernandez came on in the eighth and retired the first two batters he faced, before Hafner hit the first pitch he saw -- a fastball up in the zone -- over the wall in right-center.
"After the fact, I kind of wish I would have pitched around him a bit more, especially with [Yankees catcher Francisco] Cervelli on deck," Hernandez said. "I feel like that was a better matchup for me. Definitely wish I would have had that pitch back. I wish I would have slowed the game down a little bit more. It was a bad pitch."
Said Hafner: "I think you're looking to be aggressive and you're looking for a good pitch to hit, something you can drive. And I was able to put a good swing on the ball and fortunately got it out."
The D-backs had built a lead against one of the game's better pitcher in southpaw CC Sabathia behind Paul Goldschmidt's first-inning, two-run homer, played outstanding defense -- especially third baseman Martin Prado -- and had gotten six strong innings from Miley before the seventh.
After the game, though, none of that seemed to provide any consolation.
"It doesn't matter what happens through the first six," Miley said. "Just, I didn't get the job done in the seventh."