Brian McCann hit a tying, three-run homer off Sam Dyson, Didi Gregorius capped a six-run ninth inning with his two-run shot and the New York Yankees woke up late to beat the Texas Rangers 9-7 Wednesday night.

Down 7-2 and in danger of falling 10 games behind AL East-leading Baltimore, the Yankees began their comeback when McCann homered off Cesar Ramos in the eighth.

Rob Refsnyder singled off Matt Bush leading off the ninth, Jacoby Ellsbury walked and Dyson (1-2) relieved.

Brett Gardner singled and Refsnyder came home when center fielder Ian Desmond bobbled the ball for an error. After Alex Rodriguez lined out, McCann homered into the right-field bleachers, Starlin Castro walked and Gregorius lined the ball into the right-field seats for his first career game-ending homer.

Luis Cessa (1-0) allowed one run in three innings for his first big league win.

(Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed)

More From New Jersey 101.5 FM