Jake Marisnick, recalled earlier in the day from Triple-A Fresno, and Max Stassi also went deep for the Astros, who began an eight-game trip by taking two of three in Seattle. Teammate Evan Gattis went 3-for-5 with two doubles.
The Mariners dropped into a second-place tie in the American League West with Oakland, five games behind Houston.
Astros left-hander Dallas Keuchel (9-9), who had lost twice previously to the Mariners this season, allowed three runs on eight hits in seven innings. He walked one and struck out two.
The Astros opened the scoring with three runs in the second off Mariners starter Wade LeBlanc (6-2). With two outs, Gonzalez lined a homer over the left-field wall. After J.D. Davis singled to center, Marisnick hit a two-run shot to center, his eighth of the season.
The Mariners responded with two runs in the bottom of the inning. With one out and the bases loaded, Andrew Romine grounded a single to right for his first RBI of the season. Romine was playing first base after Ryon Healy was a late scratch because of lower back tightness.
Zach Vincej, up from Triple-A Tacoma and starting at third with Kyle Seager on the paternity list, then lined a run-scoring single to right, making it 3-2.
Gonzalez, subbing at second base with reigning AL MVP Jose Altuve (knee) on the disabled list for the first time in his career, homered again in the top of the fourth, his eighth, to give the Astros a 4-2 lead.
Houston broke open the game with a four-run fifth, the big blow Stassi's three-run homer off reliever Nick Vincent, who had just entered the game. It was also Stassi's eighth of the season.
LeBlanc, a left-hander, allowed seven runs on 10 hits in 4 1/3 innings. He didn't walk a batter and struck out three.
Seattle's Nelson Cruz hit a solo homer in the sixth, his 26th.
Right-hander Adam Warren, acquired Monday in a trade with the New York Yankees, made his Mariners debut with a scoreless inning of relief. Center fielder Cameron Maybin, who was dealt to Seattle on Tuesday from Miami, went 1-for-2 and walked twice.
--Field Level Media