BOSTON - The Yankees and Red Sox have had their share of games decided by late rallies and towering home runs.
This time, it came down to a free pass.
Aroldis Chapman walked in the winning run without recording an out in the ninth inning, handing Boston a 5-4 win over New York on Friday night.
The Yankees hard-throwing closer gave up two runs in the ninth for his third blown save. New York entered tied for the major league lead with 17 blown saves.
"That happens to all pitchers," Chapman said. "Sometimes you get into a game and you have an inning like that where you're not as sharp as you would like to be."
Mookie Betts and Dustin Pedroia started the comeback with consecutive singles and a successful double steal. Betts scored when second baseman Ronald Torreyes booted Xander Bogaerts' groundball.
After an intentional walk to Hanley Ramirez, Chapman (2-1) walked Andrew Benintendi on five pitches to bring home Pedroia.
"That 3-1 pitch, I was about 90 percent take," Benintendi said. "It was gonna take a perfect pitch to swing at it."
It was New York's fourth walk-off loss of the season. The Yankees fell for just the second time this season when leading after eight innings. Chapman entered with a 6.75 ERA over his past five appearances.
Robby Scott (1-1) got the win for the Red Sox, who got their first victory over the Yankees at home this season. It was Boston's first game-ending walk since Sept. 23, 2000 against Baltimore.
Gary Sanchez had a two-run home run and an RBI single for the Yankees.
New York, which entered the four-game series 3 1/2 games behind AL East-leading Boston, had won four of the five previous meetings against its rival this season.
Drew Pomeranz was on the mound for Boston's lone victory this season against the Yankees last month in New York. Pomeranz had seven strikeouts Friday, but allowed some pitches to get up in the zone. New York took advantage, scoring three runs in the fifth.
While Pomeranz was off, manager John Farrell liked the relentlessness his teammates showed at the plate to stay in the game. Most of the praise went to Ramirez. He had two hits and put the Red Sox up early, crushing his 14th home run over the left-center field fence in the third.
"He's swinging the bat like he did the second half of last year," Farrell said. "To be quite frank, we need that type of production, and he's certainly very capable."
The Red Sox had a chance to get the lead back with runners on the corners in the seventh, but Benintendi's long fly ball to center was reeled in on the warning track by Jacoby Ellsbury.
The Yankees struck first, getting on the board in their half of the third inning. Sanchez hit a hard liner that deflected off Bogaerts' glove at shortstop and fell into left field, scoring Chase Headley. New York pulled within 3-2 in fifth on an RBI single by Brett Gardner to set up Sanchez's go-ahead homer.