NEW YORK (AP) — Pinch-hitter Ryan LaMarre singled home the winning run in the 10th inning and the New York Yankees recovered to beat the Philadelphia Phillies 6-5 on Wednesday night after blowing a late three-run lead.

Gleyber Torres homered and Rougned Odor had a two-run shot for the short-handed Yankees, who have won four straight and nine of 12 heading into a four-game series at AL East-leading Boston.

READ MORE: Zsa's Ice Cream In Mount Airy Putting A Unique Spin On Classic Ice Cream Flavors With Locally Sourced Ingredients

Gary Sánchez, the automatic runner at second base, was sacrificed to third in the 10th and LaMarre batted for Brett Gardner. The Phillies deployed a five-man infield and LaMarre was swarmed by excited teammates after hitting a single to the warning track in right field off Ranger Suárez (4-2).

Brooks Kriske (1-0) pitched a scoreless 10th after the Yankees stranded runners at second and third in the ninth.

Philadelphia overcame a 5-2 deficit when it sent nine batters to the plate in the eighth against Zack Britton and Nick Nelson. Torres made an error at shortstop, and the Phillies drew four walks.

A base hit by Luke Williams off Nelson got the Phillies to 5-4. Philadelphia tied it when Ronald Torreyes scored on a wild pitch, but after walking Bryce Harper to load the bases again, Nelson retired Andrew McCutchen on a flyout to keep the score even.

Before squandering another late lead, the Yankees took a 5-2 lead in the seventh against struggling Hector Neris on Giancarlo Stanton’s single and Odor’s home run.

Jean Segura hit a leadoff homer and Harper had an RBI double, but the Phillies were 1 for 14 with runners in scoring position and lost consecutive games for the first time since dropping four straight June 20-25.

Torres homered and Greg Allen hit an RBI double in the fourth for New York.

Asher Wojciechowski became the 10th starting pitcher for the Yankees this season and allowed two runs on three hits in four innings. He struck out four, walked three and held the Phillies hitless in six at-bats with runners in scoring position.

READ MORE: Group Of Armed Young Adults, Kids From Delaware Causing Chaos In Salem County, New Jersey, Police Say

Spencer Howard permitted one hit in three scoreless innings for Philadelphia after being called up from Triple-A Lehigh Valley earlier in the day.

SHARED LONG NAME

Wojciehowski tied infielder Bill Knickerbocker for most letters in a last name in Yankees history. Knickerbocker appeared in 97 games for New York from 1938-40 and played 10 seasons for five teams.

TRAINER’S ROOM

Phillies: CF Odubel Herrera (left ankle tendinitis) went 1 for 4 in a rehab game with Lehigh Valley. … OF Mickey Moniak was optioned to Triple-A.

Yankees: RHP Jonathan Loaisiga (COVID-19) threw a bullpen and could be activated for this weekend’s series in Boston. Loaisiga said he spent three days working out at a park with LHP Wandy Peralta, who also is on the COVID-19 injured list. Loaisiga was surprised at testing positive and got tested because he was traveling to Nicaragua to visit his family during the All-Star break. … 1B Luke Voit (left knee inflammation) fielded grounders but is still a few days from full baseball activities. … RHP Corey Kluber (strained right shoulder) threw on flat ground and might throw a bullpen Friday.

UP NEXT

Phillies: LHP Matt Moore (0-1, 5.25 ERA) opens a four-game series Thursday against Atlanta RHP Charlie Morton (8-3, 3.69).

MORE NEWS: Edwin Allen Charged With Sexually Assaulting Woman In Upper Darby SEPTA Train Terminal

Yankees: LHP Jordan Montgomery (3-5, 4.18 ERA) begins a four-game series Thursday at Fenway Park against Boston RHP Tanner Houck (0-2, 3.38).