NEW YORK — Jacoby Ellsbury and Didi Gregorius came off the bench and hit back-to-back homers in the seventh inning, sending the New York Yankees to a 3-0 victory over the Los Angeles Dodgers on Tuesday night.

Gary Sanchez added a leadoff home run in the eighth, CC Sabathia pitched three-hit ball for 6 1/3 innings and the Yankees helped their unexpected playoff push by winning for the eighth time in 10 games.

New York began the night two games behind Baltimore for the second AL wild card.

Prized rookie Julio Urias was pulled in the fourth by the Dodgers, who had won seven of nine before their latest offensive flop against left-handed pitching.

They entered play with a four-game lead in the NL West over San Francisco, which hosted San Diego later.

Adam Warren (3-1) retired both batters he faced, and Dellin Betances got four outs for his 11th save.

Ellsbury and Gregorius homered off Ross Stripling (4-7).