NEW YORK (AP)Xander Bogaerts took his lead off third and wanted to be extra aggressive.

”I just had in my head I had to be ready,” the four-time All-Star said. ”As soon I saw it bounce, I just took a chance and went.”

Bogaerts slid across the plate with the tiebreaking run in the 11th as Michael King’s slider bounced off Jose Trevino and back toward the mound, and the Boston Red Sox recovered from a meltdown in the ninth to beat the New York Yankees 5-4 Friday night for just their third win in 11 games.

All three of those Boston wins have come against the Yankees, who have the best record in the majors at 62-28 but have lost five of six in their worst stretch this season. Giancarlo Stanton hit a three-run homer off Nathan Eovaldi, who made his first start since June 8 after recovering from lower back inflammation.

”A little adversity never hurts anybody. I think we’ll be fine,” Trevino said.

New York, which took a 3-2 in the third on Stanton’s 24th homer, went 2 for 15 with runners in scoring position.

Stanton put the Yankees ahead 3-2 in the third on a 2-0 cutter. Stanton has four homers in seven games against Boston this year and 13 of his 24 long balls have been to the opposite field.

”We should have won that game. We had our chances and just couldn’t break though,” said Yankees manager Aaron Boone, ejected for the fifth time this season, again for arguing low called strikes.

Rafael Devers hit a two-run homer in the first off Jordan Montgomery, Christian Vazquez tied the score 3-3 with a solo drive in the fourth and Bobby Dalbec hit a go-ahead homer in the seven th for the Red Sox, who arrived after getting swept in a four-game series at Tampa Bay.

”It was a big win for us to get back on track,” Eovaldi said.

Dalbec, in a 1-for-15 slide coming in, put the Red Sox ahead 4-3 when he pulled a slider from Aroldis Chapman for his seventh home run this season.

Before a season-high crowd of 47,573, New York tied it in the ninth off Tanner Houck (5-3), who blew a save for the first time in seven chances. Gleyber Torres reached on an infield hit, Matt Carpenter was hit by a pitch and Houck threw past third on Isiah Kiner-Falefa’s bunt as Torres scored.

Houck got out of further trouble when Trevino bounced into a 5-2-3 double play and DJ LeMahieu grounded out. Then in the 10th, Houck escaped a first-and-third, one-out jam when Torres grounded into an inning-ending double play.

Alex Verdugo’s leadoff fly to the left-field warning track against King (6-2) in the 11th advanced Bogaerts, the automatic runner who had stranded the bases loaded when he struck out in the 10th against Clay Holmes.

Both Trevino and King scampered to retrieve the bounced pitch with two outs.

”I’ve just got to keep it closer,” Trevino said.

The catcher reached the ball on the grass, failed to come up with it and fell as Bogaerts reached the plate.

”Sometimes he doesn’t look pretty running-wise,” Red Sox manager Alex Cora said, ”but when he has to go, he goes.”

EXTRA EXTRA

Coming off two losses in a three-game series to the Reds, the Yankees played a third straight extra-inning game for the first time since May 2001.

SAVE

Ryan Brasier retired three straight batters for his first save since June 17, 2019, ending a 4-hour game by getting Aaron Hicks on a full-count checked swing strikeout called by third base umpire Jim Reynolds.

TOSSED AGAIN

Boone was ejected by plate umpire D.J. Reyburn after arguing a first-pitch strike Carpenter in the ninth that appeared low, an inning after 6-foot-8 Aaron Judge was called out on strikes on a pitch below the knees.

”I don’t think we need to do the automated strike zone. I think the umpires do a great job as it is,” Judge said. ”That’s part of the game. It’s the human element.”

Judge has had 58 pitches outside the strike zone called strikes, most in the majors.

”I talk to people. They’re doing the best they can,” Boone said.

FOOD FOR THOUGHT

Cora, speaking on why he likes Yankee Stadium, praised visiting clubhouse chef Miguel Ramirez.

”He’s the best in the business,” Cora said. ”The rice and beans and the steak, it’s amazing. Whatever I want, Latino-wise, they’ll fix it. And the coffee’s good, too.”

TRAINER’S ROOM

Red Sox: Garrett Whitlock had been sidelined since June 7 with right hip inflammation, struck out three over two perfect innings. LHP Matt Strahm was placed on the IL retroactive to Wednesday and RHP Phillips Valdez was optioned to Triple-A Worcester.

Yankees: RHP Domingo German, sidelined since spring training with right shoulder impingement, allowed three hits over six scoreless innings for Scranton/Wilkes-Barre in his fifth rehab start, throwing 50 of 65 pitches for strikes. Boone said German could move into Luis Severino’s rotation slot after the All-Star Game. … OF Miguel Andujar was scratched from Scranton’s lineup with a neck injury. … RHP Miguel Castro left before the game to have an MRI on his right shoulder. … 3B Josh Donaldson’s right index finger was in a splint after getting hit by a pitch on Thursday. He struck out as a pinch-hitter in the 11th. … Hicks pinch hit and popped out in the seventh, then went to left field in his first appearance since fouling a pitch off his right shin on Tuesday.

UP NEXT

RHP Jameson Taillon (9-2) starts Saturday for the Yankees on five days’ rest and RHP Nick Pivetta (8-6) is on the mound for Boston.

More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports