A few hours after Mark Teixeira vowed to “enjoy every last at-bat,” the rest of the Yankees seemed dead set on doing the exact same thing. The plate sure was an enjoyable place for them against Indians pitching on a night that showed the Yankees have not given up on batting even if they have given up on winning the pennant.

They pounded 16 hits, including a grand slam by Starlin Castro, a solo shot by Aaron Hicks, a triple by Brett Gardner and a 4-for-5 effort by Jacoby Ellsbury in a 13-7 victory over the Indians on Friday night at Yankee Stadium.

The occasion for Teixeira (2-for-4) was his announcement Friday afternoon that he will retire at the end of the season. The motivation for his teammates was the chance to keep jobs and to face the pitching staff of a stagnant first-place club. The Indians have a worse record since the All-Star break than the Yankees do (9-10 vs. 11-10). Starter Josh Tomlin (11-4) and the other Cleveland pitchers allowed eight walks, four in the sixth inning.

All of the hitting made the path easier for Michael Pineda (6-10).

Despite their showing Friday night, the Indians are another of the role-reversal teams this year. They are division leaders and were trading-deadline buyers. “Man, coming to the ballpark sure is fun,” manager Terry Francona said before the game, mindful that other clubs still have more resources than they do. “But that makes it all the more fun,” he added.

Fun for the Yankees, in contrast, is overcoming lowered expectations and watching the future develop. On Friday night, it was seeing Gary Sanchez behind the plate. Joe Girardi mentioned before the game that catching is the most difficult position to master in the big leagues. It involves learning the skills and personalities of the pitching staff, retaining scouting reports, blocking and framing pitches and throwing out runners. “And you’ve got to hit,” said Girardi, a former catcher.

It appeared the Indians were in a rush to test Sanchez’s arm, running against him in each of the first two innings. He retired both of them, helping Pineda.

He was helped even more by offensive support, what with Teixeira ripping a double off the rightfield wall in the first, setting up a run that scored on Brian McCann’s groundout to second. The Yankees went further in the third, beginning with a double by Ellsbury, a single by Teixeira, a run-scoring double by McCann and an intentional walk to Chase Headley. Castro hit his first career grand slam, an opposite-field shot to rightfield, for a 6-0 lead.

After the Indians got back in it with a three-run homer to left by No. 9 batter Chris Gimenez in the fifth, the Yankees made it 7-3 in the bottom of the inning on a two-out walk to Castro and a double to right-centerfield by Sanchez. They kept adding from there, building an 11-4 lead and withstanding a poor relief outing from Johnny Barbato (a walk and three singles in the eighth). Gardner’s two-out, two-run single in the bottom of the eighth gave them some breathing room at 13-7, even though Dellin Betances still had to warm up when Nick Goody struggled in the ninth.

Said Teixeira, “We’re still fighting and I’m proud of our guys for fighting.”

Notes & quotes: Greg Bird, a potential replacement for Teixeira at first base, is taking batting practice and should be ready for the Arizona Fall League, Girardi said. But he could have big competition in spring training from Tyler Austin. “You look at his numbers in Triple-A and they’re off the charts,” Girardi said . . . Francona on Clint Frazier and the three other minor-leaguers his team traded to the Yankees for Andrew Miller: “We gave up four really good prospects . . . It will be hard for me to root against them unless they’re playing against us because you get to know them. You get pretty fond of them.”