It was like a scene from one of Brian Cashman’s wildest dreams: Chris Parmelee, signed for the baseball version of minimum wage, smoking a ball the opposite way for a game-tying home run as the Yankees continued to claw toward the goal of postseason relevance.

To which Parmelee said, I’ll do you one better.

Parmelee, making his Yankee debut after being signed to a minor-league contract in February, smacked homers in the sixth and seventh inning — the second one was a two-run shot — en route to a 12-6 win at Yankee Stadium on Wednesday, the Yankees’ third victory in a row. The lefthanded hitter went 3-for-5, all extra-base hits, and, perhaps most importantly, gave the Yankees continued hope that between he and Rob Refsnyder at first base, they’ll be able to survive Mark Teixeira’s DL stint.

Pretty good for someone Joe Girardi said he was still feeling out.

“I thought I’d give Ref a day off and see what Parm can do,” Girardi said, his voice sounding like a shrug. “He’s had some success off of [Angels starter Jered] Weaver. I said I was going to play them both.”

That decision helped erase a forgettable few innings. The box score will say Nathan Eovaldi took a no-decision and Weaver took the loss, but both had equally messy, ineffectual performances by two pitchers who spent the better portion of the evening standing dejectedly on the mound while runners circled around them like gleeful vultures. (Reliever Anthony Swarzak got the win in his Yankee debut).

Carlos Beltran was 3-for-4 with two runs, three RBIs and a home run. Brett Gardner was 3-for-5 with two RBIs, and Jacoby Ellsbury (2-for-3) homered in the third.

The Yankees trailed for the majority of the game before scoring four in the sixth, sparked by Parmelee’s solo shot, which tied the game at 5. They scored four more in the seventh off Greg Mahle. Eovaldi allowed five earned runs on 10 hits in 51⁄3 innings, with a walk and four strikeouts, while Weaver tried to match him pitch for pitch. His line: 51⁄3 innings, nine hits and six earned runs, two walks, two strikeouts.

The Angels scored just three batters into the game, when Mike Trout lined a single up the middle to plate Kole Calhoun, who stroked a one-out, ground-rule double on Eovaldi’s fourth pitch of the game. Despite four straight hard-hit balls, Eovaldi contained the damage, striking out Johnny Giavotella swinging to end the inning.

The Yankees made good on Eovaldi’s stop in the bottom of the frame — Ellsbury and Gardner hit back-to-back doubles to tie it at 1. Alex Rodriguez’s single to left one batter later brought Gardner home for the lead. The two teams continued to trade blows behind their deeply embattled pitchers, and the Yankees managed to score even when the inning looked to be over.

Down 4-3 in the fourth, Ellsbury appeared to have made the final out on a fly out to right, before being awarded his MLB-leading sixth catcher’s interference of the year. Gardner singled in the next at bat to bring Parmelee home.

Back-to-back doubles from Trout and Pujols led off the fifth and reclaimed the Angels’ lead, 5-4, but the combination of Weaver and reliever Jose Alvarez made short work of that advantage.

“Right now, we’re feel like we’re playing better baseball,” Beltran said before the game. “Just approaching every day with the mentality of going out and trying to do the best I can to try to help the team win and try to put together good at bats.”

Even from some of the most unexpected places.