BOSTON — The Yankees’ already minuscule playoff chances took another hit Sunday, and that was before they took the field trying to avoid a four-game sweep by the Red Sox.

They received news in the afternoon that Starlin Castro very well could be lost for the season with a Grade 1 right hamstring strain. The second baseman has 21 home runs and has been one of the Yankees’ most consistent offensive performers in the second half, as well as a solid presence in the field.

Speaking before Sunday night’s game, Joe Girardi said he’s viewing Castro’s return this season as a “bonus,” not something he’s counting on. “Hopefully it’s not more than a week, but I still think that’s probably pushing it,” he said. “You’re hoping that he heals quick.”

Castro left Saturday’s game in the fifth inning, pulling up as he headed toward second base with a double. Two innings later, centerfielder Jacoby Ellsbury suffered a bone bruise in his right knee while attempting to make a sliding catch in Fenway Park’s triangle in center. Ellsbury, who also had an MRI in New York on Sunday, is day-to-day.

Girardi said Ellsbury — and Castro, for that matter — will meet the Yankees in St. Petersburg, Florida, where they will start a three-game series against the Rays on Tuesday night. “We’ll see how he feels Tuesday,” Girardi said of Ellsbury, but he didn’t sound optimistic that he will be returning right away. “We’ll try to get him back as quick as we can,’’ he said, ”but being a centerfielder, you have to be able to run is the bottom line.”

The result of the injuries was a makeshift lineup Sunday night, one that included three players who were not with the Yankees six days earlier.Donovan Solano, who spent the season with Triple-A Scranton/Wilkes-Barre, started at second base and Mason Williams, called up from Scranton on Wednesday, started in centerfield. Billy Butler, signed off waivers on Thursday, started a second straight game at first base after serving as the designated hitter in the first two games of the series.

advertisement | advertise on newsday

Solano singled, Williams doubled and both scored in the fourth inning as the Yankees took a 4-0 lead. Gary Sanchez hit his 16th home run in 41 games and 156 at-bats an inning earlier, a solo shot over the Green Monster that ricocheted off a sign and went back onto the field..

But Hanley Ramirez hit a three-run homer off CC Sabathia in the fifth, Jackie Bradley Jr. had a tying RBI single in the sixth and Ramirez homered again in the seventh for a 5-4 lead. That made him 9-for-16 with four homers, a double and nine RBIs in the series at that point.

That meant the Yankees had blown a 5-1 lead in Thursday night’s 7-5 loss, a 5-2 lead in Saturday’s 6-5 loss and a 4-0 lead on Sunday night.

Rookie Ronald Torreyes got the start at third base in place of Chase Headley, whose lower back flared up during Saturday’s loss. “After the game, he was really stiff. He’s still really stiff today,” Girardi said.

Of the hodgepodge lineup he put out, Girardi all but shrugged. “It’s kind of the choices that we had,” he said.

Yankees videos

The lineup resembled something the Yankees might have sent to Bradenton, Florida, in late March during spring training for a split-squad game. “We might get fined if we sent that,” one Yankee joked, a reference to the discipline meted out against clubs for not sending enough of a “representative” team on the road for exhibition games.

The Yankees entered Sunday night with a 3.4 percent chance of grabbing a playoff spot, according to FanGraphs’ projections. Going into the game, they had lost four straight and six of seven after a seven-game winning streak that moved them within one game of a wild-card spot on Sept. 10.

Girardi, however, remained resolute in his confidence that the Yankees will, against the odds, make the playoffs. He still believes. “I do,’’ he said. “I wouldn’t do the things during the course of the games [I do] if I didn’t think we were going to make the playoffs, that’s the bottom line. So you have to believe. It’s who we are. You have to overcome challenges and adversity and injuries and everything that happens, but I believe.”

The Yankees sent Sabathia to the mound in hopes of ending the losing streak. Sabathia (8-12, 4.10 ERA), who has had an up-and-down season, had performed well of late. In his previous five starts, he was 1-2 despite a 2.40 ERA. In the 11 starts before that, he was 2-6 with a 6.78 ERA. And in the seven starts before that, he was 4-2 with a 0.82 ERA.