MLB

Hafner’s HR helps Yankees rally past Diamondbacks

The smoke and mirrors used by the Yankees to avoid drowning in the early AL East waters didn’t arrive at Yankee Stadium until the seventh inning of Wednesday night’s game against the Diamondbacks.

When they surfaced, a pitching gem by Wade Miley was ruined and Travis Hafner’s pinch-hit homer in the eighth allowed the Yankees to dance into the cool evening with a 4-3 victory in front of an announced crowd of 34,369 at the Stadium.

Trailing, 3-0, going into the seventh, the Yankees scored three runs in the inning and chased Miley, a 16-game winner last year as a rookie and an All-Star who finished second to Bryce Harper in the NL Rookie of the Year race.

Hafner, who was hitting for Ben Francisco with two outs in the eighth, smoked David Hernandez’s first pitch over the right-field wall for his fourth homer of the season.

The win, which went to CC Sabathia and was saved by Mariano Rivera, was the Yankees’ seventh in eight games.

Sabathia gave up a two-run homer to Paul Goldschmidt in the first and a solo run in the fifth. And after six when Miley looked like a cross between Andy Pettitte, Tom Glavine and Cliff Lee in their primes, it appeared Sabathia was going to swallow a tough loss.

Instead the Yankees’ ace improved to 3-1 with a third straight win. He allowed three runs and six hits in eight innings. Rivera recorded the final three outs for his fourth save.

It wasn’t until Vernon Wells laced a two-out, bases-empty double to left in the sixth that the Yankees batted with a runner in scoring position against Miley.

For the second straight game, manager Joe Girardi didn’t play Ichiro Suzuki against a lefty starter, instead using the left-handed Brennan Boesch. After getting two hits off Baltimore’s Wei-Yin Chen on Sunday, Boesch went 1-for-3 versus Miley.

The hit was a bloop double in the seventh that sent Rodriguez to third. Miley walked Eduardo Nunez to load the bases for Jayson Nix, the No.9 hitter.

Pitching coach Charles Nagy visited the mound, but Miley walked Nix for the second time in the game, forced in a run and was replaced by lefty Tony Sipp to face Brett Gardner.

At 2-2, Gardner laced an opposite-field single to left that scored Boesch easily from third and because of an aggressive send by third base coach Rob Thomson, Nunez from second. Nix made third and when A.J. Pollock’s throw went all the way home, Gardner cruised into second.

Right-handed reliever Brad Ziegler surfaced from the pen and required one pitch to get Wells to bounce out, strand two and keep the score tied, 3-3.

george.king@nypost.com