MINNEAPOLIS — Only those not paying attention to the 2016 Twins felt the four-run deficit Michael Pineda put the Yankees in after six innings Saturday afternoon was insurmountable.

For those who had been following closely, what happened next seemed inevitable.

Alex Rodriguez hit a two-run homer off Ricky Nolasco, who had shut the Bombers out the first six frames, in the seventh and Carlos Beltran blasted a two-run shot off Kevin Jepsen in the eighth to tie it.

The Yankees further battered the Twins’ taxed and terrible bullpen in the ninth, with Jacoby Ellsbury’s two-run single the big hit, which paved the way for a 7-6 victory in front of 30,760 at Target Field.

“Good character win today for us,” A-Rod said.

The Yankees (34-34), somewhat depressingly from their standpoint, have just one more game here against the Twins (20-48), who may struggle to win 50 games this season. On the other hand, the Bombers do get three more against them next weekend at the Stadium.

advertisement | advertise on newsday

After lefthander Fernando Abad loaded the bases with none out in the ninth, righthander Ryan Pressly came on to face pinch-hitter Starlin Castro. Castro struck out but Ellsbury, with the infield in, punched a full-count, 96-mph fastball to right to make it 6-4. Brett Gardner’s sacrifice fly made it 7-4.

“Once it got to 3-2, I was thinking he was going to come with an offspeed pitch,” said Ellsbury, who went 2-for-5 and has five RBIs in his last five games. “I told myself to sit offspeed but stay short. It ended up being a fastball and I stayed short enough to hit the ball hard.”

The odd inning included a walk, a bunt single (by Didi Gregorius, who was attempting to sacrifice on his own), a passed ball, an intentional walk, a wild pitch and Ellsbury’s single.

“It was just good at-bats,” Joe Girardi said. “You want to have a team that grinds out at-bats. We have guys that have been around a long time.”

Aroldis Chapman gave the Yankees dugout a couple of palpitations in the ninth, allowing two out homers to Eduardo Escobar and pinch hitter Kurt Suzuki. He got pinch hitter Trevor Plouffe to ground to second, which secured his 13th save in 14 chances.

Yankees videos

“When that happens, you can’t lose your concentration, your job is to get the next guy out,” Chapman said through his translator of the back-to-back blasts. “Definitely, when you have three runs (as a lead), and you give up two and still get the save and the win (by the team), you feel like you didn’t fail. You didn’t put up a zero but at the same time you win the game. Very fortunate.”

Pineda was again inconsistent for the Yankees, allowing four runs — three earned — and six hits over 5 1⁄3 innings. The 27-year-old allowed an RBI single by Escobar in the second, a two-run homer by Byung Ho Park in the fourth and an unearned run in the sixth on his own error when, after Ike Davis made a nice stop on Max Kepler’s smash, he missed first base taking the throw. Anthony Swarzak, who struck out two over 1 2⁄3 scoreless innings, allowed a sacrifice fly that made it 4-0, the run charged to Pineda, whose ERA sits at 5.82.

“I thought his stuff was really good,” Girardi said. “The big mistake he made was to Park, he left a fastball up. The changeup Escobar hit was not necessarily a bad pitch…but I thought his stuff was really good today.”

Nolasco, who didn’t exactly tote Cy Young candidate numbers into the afternoon — 3-4 with a 5.12 ERA — allowed two runs and eight hits over seven innings.

He had a 4-0 lead in the seventh before the 695th homer of A-Rod’s career made it 4-2. Beltran’s team-best 18th homer of the season in the eighth tied it at 4-4.

advertisement | advertise on newsday

“We didn’t have anything going,” A-Rod said of the impact his hit might have had. “We were down 4-0 and kind of sleepwalking through the first six. We got something going.”