If there had been one positive to the drudgery that had been the Yankees’ month-old season it was this: The club had mostly avoided injury.

That seems to have ended. For the third time in two days, a big name went down, with Jacoby Ellsbury the latest.

The centerfielder left Friday night’s game, a 3-2 victory over the Red Sox at the Stadium in which the Yankees survived a wild ninth inning, with tightness in his right hip.

Aaron Hicks, off to a nightmare of a start in his first season as a Yankee, hit a tiebreaking homer off Rick Porcello in the seventh inning to break a 2-2 tie. Hicks’ first homer of the year improved him to 4-for-35 (.114).

Then the Yankees went into survival mode.

Dellin Betances allowed a two-out infield single in the eighth and Joe Girardi brought in Andrew Miller, who walked a tightrope the rest of the way. He walked former Yankee Chris Young but struck out Jackie Bradley Jr. looking at a slider.

After Josh Rutledge reached on an infield single in the ninth, Miller struck out Mookie Betts, but singles by Dustin Pedroia and Xander Bogaerts loaded the bases for — who else? — David Ortiz, who had hit a two-run homer in the first inning.

Ortiz got ahead 3-and-1 before taking a sharp-breaking slider that he thought had forced home the tying run, but Ron Kulpa called it a strike, prompting an immediate objection from Ortiz. Brian McCann was crossed up and caught the ball poorly, making the pitch, which wound up low and away, look even worse than it was. Manager John Farrell got between Ortiz and Kulpa, who soon threw out Farrell.

Ortiz took the next pitch, too, and Kulpa punched him out for the second out. After returning to the dugout, Ortiz was ejected and stormed back on the field to get in Kulpa’s face. After order was restored, Miller struck out Hanley Ramirez swinging for his sixth save.

It was a positive start for the Yankees (10-17) on a 10-game homestand, though the injury to Ellsbury put a cloud over it. The prognosis was not immediately known, though he was scheduled for an MRI.

On Wednesday, the Yankees put Alex Rodriguez on the 15-day disabled list with a right hamstring strain and earlier yesterday, CC Sabathia landed on the DL with a left groin strain.

Ellsbury, who had 16 hits in his last 53 at-bats (.302) entering the game, appeared to tweak something taking a big turn around third on a stolen base in the first, when Porcello’s pitch got away from catcher Christian Vazquez.

He was replaced in center in the top of the second by Hicks, who started in right. Dustin Ackley took over for Hicks.

Michael Pineda shook off a 28-pitch first inning in which he allowed a two-run homer to Ortiz to post a solid outing, allowing two runs and eight hits in six innings.

With two outs in the first, Bogaerts sliced a double down the rightfield line. After getting ahead 1-and-2, Pineda hung a slider that Ortiz lasered into the seats in right-center for his seventh homer, making it 2-0. It was Ortiz’s 50th regular-season homer against the Yankees (49 with Boston, one with the Twins) and his 10th in his last 27 games against them.

Ellsbury drew a four-pitch walk in the bottom of the first, stole second and third and scored on McCann’s two-out double. The Yankees tied in the second on Ackley’s two-out single.