BOSTON — The deadline sell-off left the Boston Red Sox with a pitching staff headed by Clay Buchholz.

In short, he is being asked to be the ace for the rest of the season.

Oops.

Buchholz endured his third consecutive bad start and failed to hold a pair of three-run leads Sunday night, yielding seven runs in five innings during Boston’s 8-7 loss to the New York Yankees.

Story continues below advertisement.

“It’s been a frustrating year for everyone in here,” he said. “Obviously the organization, we don’t want to go out there and wear a Red Sox uniform and perform the way I am. I need to pick it up during the season.

“When things are going good, they fall into place. When they’re going bad, a lot of things happen.”

Buchholz has allowed 18 earned runs in 16 innings over his past three starts.

He left Sunday night’s game with the score tied 7-7, but the Red Sox went on to lose their 10th game in the last 12 — and fall to a season-worst 13 games under .500 (49-62).

Yankees starter David Phelps, pounded early, departed after two innings with right elbow inflammation.

The Yankees said the ineffective Phelps, who allowed five runs and six hits in two innings in putting his team in 3-0 and 5-3 holes, will be evaluated by doctors this week in New York.

The victory allowed the Yankees (57-53), who twice rallied from three-run deficits, to win two of three against the Red Sox (49-62) and go 3-3 on this trip that started last Monday in Texas against the Rangers.

“We feel as though we have a hot streak coming,” Derek Jeter had said after Saturday’s 6-4 victory. “But you have to go out and do it.”

Behind leadoff man Brett Gardner, clearly the team’s offensive MVP this season, the Yankees did just that for a second straight game. Gardner went 3-for-4 with a homer, a double, a walk and three RBIs, and his sixth-inning blast off lefthander Craig Breslow gave the Yankees an 8-7 lead that stood up.

Stephen Drew, acquired from the Red Sox just before the trade deadline on Thursday, hurt his former team, going 2-for-4 with a double and four RBIs, including a two-out, two-run single in the fifth that tied the score at 7-7. Carlos Beltran added two hits and scored two runs.

But the night’s MVP might have been Esmil Rogers, an under-the-radar waiver claim from the Toronto Blue Jays on Thursday. The righthander, who struggled with his fastball and slider with the Blue Jays, had both pitches going during three crucial scoreless innings — innings 5-7 — in which he did not allow a hit.

Dellin Betances mowed through the Red Sox in order in an 11-pitch eighth, striking out two, and turned it over to David Robertson, who improved to 29-for-31 in save chances this season.

Robertson had a 1-2-3 ninth, but it wasn’t that easy. He walked Christian Vazquez and, after pinch runner Mookie Betts took off for second, was bailed out when Brock Holt smoked a liner to Chase Headley at third. Headley easily doubled off Betts for the second out. Robertson then fell behind Dustin Pedroia 3-and-0, and moments after his bid for a tying home run went about 10 feet foul, Pedroia concluded a nine-pitch at-bat by grounding out to short.