HOUSTON – Stephen Strasburg took a gem into the ninth inning and Juan Soto ran all the way to first base with his bat after a go-ahead home run, the same way Houston slugger Alex Bregman did earlier.

The Washington Nationals have matched the Astros pitch for pitch, hit for hit, win for win — even home-run celebration for home-run celebration.

Now, it’s on to a winner-take-all Game 7 on Wednesday to decide the first World Series in which the visiting team won each of the first six games.

“It’s weird, really. You can’t explain it,” Washington manager Dave Martinez said.

Adam Eaton and Soto hit solo homers off Houston starter Justin Verlander in the fifth, Anthony Rendon also went deep and drove in five runs, and the Nationals beat the Astros 7-2 on Tuesday night to tie the Fall Classic at three games apiece.

Fired up after a disputed call at first base went against them in the seventh, the Nationals padded their lead moments later when Rendon homered off Will Harris.

Martinez, still enraged at umpires, was ejected during the seventh-inning stretch, screaming as two of his coaches held him back while the crowd sang along to “Deep in the Heart of Texas.”

Strasburg gutted through without his best fastball to throw five-hit ball for 81/3 innings. He threw 104 pitches, struck out seven and walked two.

Washington pitching coach Paul Menhart told Strasburg after the first inning he was tipping pitches. Strasburg allowed only three more hits.

“Started shaking my glove, so they didn’t know what I was throwing,” he said. “It’s something that has burned me in the past, and it burned me there in the first.”

Nationals pitcher Max Scherzer, boosted by an injection of painkiller, is primed to return from an irritated nerve in his neck to start Game 7, Martinez said.

Scherzer was warming up in the seventh inning before Rendon’s homer, then sat down as Martinez became the first manager tossed from a World Series game since Atlanta’s Bobby Cox in 1996.

“Anytime we get Max on the mound for us, we like our chances,” Rendon said.

The Nationals will attempt their ultimate comeback in a year in which they were written off time after time, hoping for the first title in the 51-season history of a franchise that started as the Montreal Expos and the first for Washington since the Senators in 1924.

Zack Greinke will be on the mound in Game 7 for the Astros, who led the majors with 107 victories and are seeking their second title in three seasons.

Visiting teams have won three straight Game 7s in the Series since the St. Louis Cardinals defeated Texas at home in 2011.

Washington rebounded from a 19-31 start — the Nats were given just a 1.6% chance to win the Series on May 23 — to finish 93-69.

They rebounded from a 3-1 eighth-inning deficit against Milwaukee in the NL wild-card game, a two games to one deficit versus the Los Angeles Dodgers in the Division Series and a 2-1, fifth-inning deficit in Game 6 against the Astros.

Outscored 19-3 in three games at Nationals Park while going 1 for 21 with runners in scoring position, the Nationals got the strong outing they needed from Strasburg, who allowed his only runs in the first inning.

“It was a mental grind out there, especially after the first,” Strasburg said. “Just got to keep fighting.”

Strasburg improved to 5-0 in six postseason starts this October despite failing to get a swing and miss in the first two innings for the first time this year, and eight of nine swings and misses overall were on breaking balls.

Strasburg escaped a two-on, two-outs jam in the fourth by striking out Carlos Correa.

After George Springer’s one-out double put runners at second and third in the fifth, Jose Altuve struck out on a curve in the dirt and Michael Brantley hit a hard grounder to second.

Sean Doolittle got the final two outs as the Nationals bullpen headed into Game 7 relatively rested. He gave up a two-out double to Correa before retiring Robinson Chirinos on a popup.

Verlander dropped to 0-6 with a 5.68 earned-run average in seven Series starts, a blemish on his otherwise sterling career.

“Hey, there’s been some good games mixed in with some not-so-good ones,” Verlander said. “I can’t point a finger to anything in particular. I’m going out there and trying my best. Just wasn’t able to come away with a win.”

In the first game with lead changes since the opener, Rendon’s RBI single through a shifted infield put the Astros ahead in the first.

Verlander gave up 10 runs in the first inning during six postseason starts this year after allowing 12 during 34 regular-season outings.

Bregman put the Astros ahead 2-1 on Strasburg’s 12th pitch, driving a fastball over the left-field scoreboard for his fourth home run of the postseason and third of the Series.

Bregman carried his bat out of the batter’s box and tried to hand it to first base coach Don Kelly, only for the bat to fall as Kelly stuck out his hand for a shake. Bregman apologized after the game for carrying the bat so far.

Eaton tied the score in the fifth when Verlander hung a slider. Soto, who homered at age 20 in the opener, followed one out later with his second long ball after turning 21. He lined a high-and-inside fastball into the right-field upper deck, a no-doubt drive Verlander didn’t bother to watch.

Soto, too, flipped the bat at his first-base coach, Tim Bogar.

“I don’t think there’s a person in the building that would have assumed that all road teams were going to win,” Houston manager AJ Hinch said. “We’ve just got to make sure that last one is not the same.”

On the play that led to Martinez’s ejection, the Nats’ Trea Turner was called out for interference by plate umpire Sam Holbrook.

Turner, who hit a slow roller down the third-base line, ran narrowly inside fair territory. Pitcher Brad Peacock fielded the ball, and his throw pulled first baseman Yuli Gurriel toward the base line. As Gurriel stretched, Turner ran into his glove, and the ball bounced off Turner’s leg and into foul territory. Turner ended up at second, with lead runner Yan Gomes going to third — except Holbrook quickly signaled for interference.

Turner was called out and Gomes sent back to first base.

After a 10-minute delay for video review, that ruling was upheld.

“The call was the fact that he interfered with Gurriel trying to catch the ball,” MLB executive Joe Torre said, adding Holbrook “made the right call at first base.”