SEATTLE — If only Collin McHugh could face the Seattle Mariners every time out.

The Houston right-hander continued his mastery of the Mariners on Friday night, allowing only two hits in seven stellar innings in the Astros’ 6-0 win over Seattle.

Houston ended Seattle’s eight-game win streak thanks to McHugh’s performance and solo home runs from Evan Gattis and Marwin Gonzalez. The Astros and remained four games behind Baltimore and Toronto in the AL wild-card race.

“We needed that on a lot of levels. Every game is magnified this time of year and we were playing a team that we’re chasing,” Houston manager A.J. Hinch said.

McHugh was outstanding in baffling the surging Mariners all night, not allowing a base runner until Nori Aoki’s leadoff single in the fourth inning. Seattle’s only other hit off McHugh was Kyle Seager’s single with two outs in the seventh.

McHugh (11-10) improved to 9-3 in his career against Seattle and 4-0 this season with a 1.08 ERA. He’s 6-0 in his career pitching at Safeco Field.

“I think we just match up pretty well with them, at least me,” McHugh said. “Whether it’s pitch mix, pitching in this park, the times I’ve been able to throw against this team I’ve been able to have some success. I don’t know what the formula is.”

McHugh won his fourth straight decision with one of his strongest outings of the season. He completed seven innings for just the second time in his previous 14 starts. McHugh also allowed just two hits in his last start against the White Sox, but managed just five innings in that outing.

Meanwhile, Seattle starter Felix Hernandez (11-6) stumbled in his biggest start of the season. With the Mariners back in the AL wild-card race, Hernandez failed to get through five innings, giving up five earned runs and eight hits.

The solo homers by Gattis and Gonzalez in the fifth were the capper to Hernandez’s miserable night. Gattis led off the inning with his 27th home run and Gonzalez followed with his 13th that knocked Hernandez from the game. Gonzalez now has 37 career home runs, 11 of those against Seattle.

Hernandez was in trouble long before the two home runs. Jake Marisnick’s two-run double in the second inning gave Houston the lead and the Astros added on with Carlos Correa’s RBI double in the third after Jose Altuve reached on an error and Yuli Gurriel added an RBI single in the fourth.

“These guys hit the fastball, they really are on it, and if you can’t land your secondary pitches or kind of get them going back and forth, it’s going to be a long night for you,” Seattle manager Scott Servais said. “Certainly was not on top of his game tonight.”

Hinch praised the patience of his hitters laying off pitches just outside of the zone and making Hernandez throw strikes.

“We didn’t chase a lot tonight and if you don’t chase with him and you make him bring the ball in the strike zone he’s human again,” Hinch said.

HEALTHY ALTUVE

Altuve looked just fine after leaving Wednesday’s game against Texas with an apparent oblique injury. After being checked out by doctors in Houston on Thursday, Altuve had two hits and was on base four times, twice reaching on errors. He scored his 100th run of the season and collected his 40th double.

“He’s Jose Altuve. He does nothing wrong,” Hinch said.

TRAINER’S ROOM

Astros: 3B Alex Bregman could miss the rest of the regular season with a hamstring injury suffered on Wednesday. Bregman did not travel with the team for its road trip and remained in Houston to get treatment.

Mariners: Even after a day off, 1B Adam Lind still had some pain around his thumb and was out of the lineup for a fourth straight game. Servais was hopeful Lind would be available on Saturday.

UP NEXT

Astros: RHP Mike Fiers (10-7) makes his 28th start of the season. Fiers lasted just 3 1/3 innings in his only other start against Seattle this season, giving up four earned runs.

Mariners: LHP James Paxton (4-6) will make his fifth start since coming off the disabled list on Aug. 25 but does not have a win since Aug. 7.