Ronald Torreyes added a sacrifice fly and Aroldis Chapman recorded his 15th save despite walking the bases loaded in the ninth as the Yankees (61-53) trimmed their deficit in the American League East to 3 1/2 games behind the Red Sox (64-50).
The unlikely comeback took place after the Red Sox had cruised through the first seven frames, carrying a three-run lead to the eighth. Hanley Ramirez and Andrew Benintendi homered in support of starter Eduardo Rodriguez, who allowed just two hits in a 107-pitch effort.