The way he’s been hitting lately, Chase Headley probably didn’t want Sunday off. But he was not in the starting lineup against the White Sox.

Headley didn’t get a whole day’s rest, though. Called upon to pinch hit in the seventh inning, he delivered a tiebreaking RBI double as the Yankees concluded a successful home stand with a 7-5 victory at Yankee Stadium.

“I want to play every day,” said Headley, who broke out of a dreadful slump this week with his first two home runs of the season and has his average up to .200. “I’m itching to be in there. I wasn’t really happy . . . But I understood.”

Headley helped the Yankees overcome a misstep by the first part of their three-man bullpen of doom.

The Yankees had a zigzagging game right where they wanted it when Dellin Betances took the mound with a 5-4 lead to start the seventh. They took the lead in the sixth on Carlos Beltran’s 400th home run, a two-run shot.

But before the Yankees could replicate Saturday’s smash debut of Betances to Andrew Miller to Aroldis Chapman, the White Sox tied it at 5 on Melky Cabrera’s RBI double.

advertisement | advertise on newsday

Betances (1-2) kept it tied. With runners on second and third, he got Brett Lawrie on a grounder to short with the infield in and struck out Avisail Garcia and Alex Avila.

Headley gave the Yankees the lead for good with a booming, first-pitch double to right-center off Matt Albers (1-2) that scored Didi Gregorius, who walked with two outs.

“I think what is important for us is that we won another series,” Beltran said. “We beat Boston, we beat Kansas City, we beat the White Sox. Those are three good teams and it really shows we’re capable of winning against good teams. It’s good to see that we’re playing better baseball. Also, it’s good to see we have Chapman in the bullpen and the three guys that we have out there to help us close out close games.”

Yankees videos

And now they have Headley to help out when one of those guys falters. Before the past week, it looked as if the switch hitter had been using one of the plastic bats the Yankees gave out to kids Sunday.

“It’s been fun,” Headley said. “When you’re not playing the way you’re capable of and the team’s not playing great, it feels good when you turn it around, both personally and the team.”

Headley’s .200 batting average might not seem like much. But he needed to go 9-for-25 (.360) on the homestand to get there.

Retaking the lead allowed Joe Girardi to call in Miller for the eighth and Chapman for the ninth. The Yankees’ trio pitched in the same game for the first time Saturday and struck out eight in 3 1⁄3 innings to preserve a 2-1 victory.

On Sunday, Miller struck out two in a perfect eighth and Chapman tossed a 1-2-3 ninth for his third save in his first week as a Yankee. The Yankees improved to 16-20 with a 7-3 homestand before leaving for a seven-game trip to Arizona and Oakland.

advertisement | advertise on newsday

Masahiro Tanaka, coming off his worst start of the season when he allowed six runs (and three home runs) in seven innings to the Royals, was only slightly better. Tanaka gave up four runs and eight hits in five innings, walking three and striking out seven, and departed trailing 4-3.

It stayed that way until the sixth, when Beltran hit his milestone home run off Zach Duke to give the Yankees a 5-4 advantage. Beltran, who has eight this season, became the 54th player and fourth switch hitter to reach 400.

Brian McCann gave the Yankees an insurance run in the eighth with his fifth home run.