NEW YORK — With a soaring shot headed for Yankee Stadium’s Monument Park, Aaron Judge got New York back on track Tuesday night for another memorable October.

Judge ignited a rousing rally with a home run, then doubled during a four-run eighth inning to spur the unflappable New York Yankees over the Houston Astros 6-4 and tie the AL Championship Series at 2-2.

The Yankees trailed 4-0 against starter Lance McCullers Jr. until Judge homered leading off the seventh. He tied it with a line drive that nearly left the park in the eighth and scored when Gary Sanchez hit a go-ahead two-run double off loser Ken Giles.

The Yankees overcame three errors and have roared back from a second straight 0-2 series deficit; they beat Cleveland in the division series by winning three straight to take that best-of-five matchup.

Aroldis Chapman struck out two in a perfect ninth to cap a three-hitter. New York improved to 5-0 at home in the playoffs and won for the 18th time in their last 21 home games.

Masahiro Tanaka will pitch Wednesday for New York against Dallas Keuchel in Game 5. It’s a rematch of the series opener, when Keuchel outdid Tanaka in a 2-1 Astros win.

Judge sparked the Yankees by chasing McCullers, who baffled the Yankees with his power breaking ball.

Except for the last one.

Judge launched a curveball into the netting above center field’s Monument Park for New York’s second hit.

“Once we’re within striking distance like that, anything can happen,” Judge said.

Houston Manager A.J. Hinch pulled McCullers after 81 pitches, Didi Gregorius tripled off Chris Devenski and Sanchez brought Gregorius in with a sacrifice fly.

“I thought Aaron’s home run just lit a little spark,” Yankees Manager Joe Girardi said.

Todd Frazier led off the eighth with a double to left and pinch-hitter Chase Headley then did the same – only after falling between first and second base, taking one step back, then heading for second and sliding in ahead of Jose Altuve’s tag.

“Panic,” Headley said. “I went from one of the best feelings of my career to one of the worst in just a matter of seconds, but fortunately it worked out.”

Brett Gardner brought in Frazier on a groundout and Judge came to bat.

He reached down to stay with a slider and drilled a double high off the left-field wall. Gardner came home with the tying run, and Gregorius grounded a single just beyond shortstop Carlos Correa’s reach to put runners at the corners. Sanchez, who had been 0 for 13 in the series, scored them both with a slicing drive that skipped to the wall in right-center.

Houston had not lost consecutive games since Sept. 8-10 at Oakland and had the major leagues’ best road record during the regular season. The Astros had just three hits and are hitting .153 in the series.

Yankees starter Sonny Gray pitched one-hit ball through five innings but again had no run support. His teammates have yet to score for him in four career postseason starts, including twice with New York this year.

Houston took a 3-0 lead in the sixth after George Springer walked leading off, and Josh Reddick reached on catcher’s interference by Austin Romine – inserted into the lineup for his defense.

Robertson walked Altuve and struck out Carlos Correa before Yuri Gurriel lined a three-run double past Frazier and all the way to the wall. Gurriel got hung up between second and third as Altuve scored, and he was tagged out by Judge to end a rundown.