A gutsy showing from Yankees starter Jordan Montgomery and a lockdown bullpen performance pushed the Yankees to a 5-1 win over the Rays, staving off elimination to knot the best-of-five American League Division Series at Petco Park on Thursday night.

Gleyber Torres provided the key offense, with a sixth-inning two-run homer.

It’ll all come down to Game 5 on Friday night, when the Yankees are slated to start ace Gerrit Cole on short rest — likely facing Tampa Bay ace Blake Snell, also pitching on short rest.

Luke Voit’s solo shot put the Yankees on the board first. He crushed Ryan Thompson’s 1-0 slider over the second deck in left-center field at 453 feet.

The Yankees would add an insurance run in the eighth, thanks to Higashioka’s line-drive single to left field. Torres, who singled and stole second, scored easily to make it 5-1.

It looked good early for the Athletics when Astros starter Zack Greinke appeared to tip his pitch before serving up a monstrous home run to the A’s Ramon Laureano for a 3-0 lead.

But for the second straight day, the Astros chased the A’s starting pitcher from the game with a five-run inning as Houston went on to rout Oakland 11-6 and complete a 3-1 series win.

The Astros scored five runs in the fourth inning on home runs by Michael Brantley and Carlos Correa.

The Dodgers steamrolled the Padres, completing a three-game sweep with a 12-3 win in Game 3 at Globe Life Field on Thursday.

The Dodgers collected 14 hits and nine walks against 11 Padres pitchers.

They advance to face the Atlanta Braves in the National League Championship Series.

Exactly one week after earning their first postseason series victory in 19 years, the Braves are moving on again. They advanced to the NL Championship Series by defeating the Marlins 7-0 in Game 3 of the NLDS Thursday, completing their second consecutive postseason series sweep.

Braves starter Kyle Wright labored early, yet pitched his way out of jams.

Travis d’Arnaud had the key hit, slamming a double to center that scored two and put the Braves up by three.

— Compiled from wire services.