BOSTON — Neither bullpen could hold a lead Friday night as the Boston Red Sox came back to beat the New York Yankees 9-6 at Fenway Park.

Mitch Moreland’s two-run single capped a four-run seventh inning, putting the Red Sox ahead again after Boston let a 3-0 lead slip away.

Jackie Bradley Jr.’s two-run single in the eighth added insurance.

Boston (70-51) leads the Yankees (65-56) by five games in the American League East.

The Red Sox took a 3-0 lead on home runs by Rafael Devers (with a runner on base) and Christian Vazquez off Yankees starter Jordan Montgomery.

Boston starter Drew Pomeranz looked to be in control until he left the game with one out in the fourth inning because of back spasms.

Brandon Workman relieved and kept the 3-0 lead through the fifth inning.

But then the bullpen faltered.

Matt Barnes gave up a two-run homer to Todd Frazier in the sixth and allowed two more hits. Joe Kelly relieved with two outs and hit Aaron Hicks to load the bases.

In an electric matchup between Kelly’s 100 mph fastballs and Aaron Judge’s power, Judge fouled off four offerings and worked a full count before grounding out to shortstop.

But Gary Sanchez led off the seventh with a towering home run, and New York scored three more runs in the inning against Kelly, Heath Hembree and Robby Scott.

Addison Reed (1-1) got the final two outs of the inning and pitched a scoreless eighth before Craig Kimbrel closed out the win in the ninth.

In the bottom of the seventh, Christian Vazquez singled with one out and Jackie Bradley Jr. walked to chase reliever Chad Green. Tommy Kahnle (1-1), one of the relievers obtained from the Chicago White Sox just before the trade deadline, allowed an infield hit by Eduardo Nunez on a dribbler toward third base. Mookie Betts drove in Vazquez with a sacrifice fly to center and Andrew Benintendi singled home Bradley.

After Hanley Ramirez walked, Moreland pinch hit for Chris Young. He fell behind 0-2, missing two change-ups. He got a third change-up and lined it to center field for a two-run single and a 7-6 lead.

NOTES: Red Sox Manager John Farrell said David Price did not throw again Friday because of stiffness in his sore left elbow. His last threw on Tuesday after throwing three times on flat ground last week.

“He has to build up to an aggressive long-toss situation and build back to the mound. That’s going to take some time. I don’t have a return date at all,” Farrell said.