After losing 3-0 on Monday, the Astros scored 24 runs on 37 hits in winning the final two games of the series. Carter, who hit two home runs in a 16-9 rout Tuesday, added three hits in this one. He finished the series 8 for 15 with three homers and five RBIs.
"Everyone's confidence was still rolling into today," Carter said.
Houston, which arrived in Seattle with a .199 batting average, hit .367 in the series to raise the team mark to .262.
"When they're finding the barrel of the bat that much they are doing things right, putting it in play," Mariners shortstop Brendan Ryan said. "At the same time, not every one has to go in the gap or over the fence. That's the way it goes, I guess."
Ankiel snapped an 0-for-13 slide with a second-inning homer. Carlos Pena had three hits and scored twice for the Astros, who also got two RBIs from J.D. Martinez and a late home run by Marwin Gonzalez.
Brad Peacock (1-1) allowed three runs and four hits in five-plus innings for his first major league win since Sept. 22, 2011, with Washington at Philadelphia.
"I had a good feeling going into today," Peacock said. "It definitely carried over. They swung the bats awesome today."
Seattle right fielder Michael Saunders sprained his right shoulder crashing into the outfield wall to make a catch in the first inning. He will be re-examined Thursday.
"It's a right AC sprain," manager Eric Wedge said. "He's going to have to miss some time. It's just a matter of how much time. It could be a DL situation. We're working through everything right now."
The Astros scored three times off Blake Beavan (0-1) in the second, highlighted by Ankiel's shot to center. Mariners pitchers have allowed 19 home runs, most in the majors.
Houston added two more runs in the third. Jason Castro reached on a two-base error when Gutierrez couldn't gather a popup in center that Ryan lost in the dusk. Castro scored on Pena's single, the first unearned run (out of 54) allowed by the Mariners this season.
Martinez doubled home Pena for a 5-0 lead.
Shoppach's first home run with the Mariners was a solo shot to left in the third. His second drive to left in the fifth required a video replay to confirm that it was a double. With Dustin Ackley on first, Shoppach hit a long shot to left-center. The ball ticked off the glove of a leaping Martinez and hit the yellow line at the top of the wall. Ackley raced around to score.
After Wedge argued that it was a home run, crew chief Wally Bell gathered the umpires and they marched under the stands to check the replay. They ruled it a double and Shoppach was left stranded.
Gutierrez's leadoff shot in the sixth ended the night for Peacock. He walked one and struck out three.
The Mariners have 14 home runs in their first 10 games. They hit just five through 10 games last season and didn't hit No. 14 until their 20th game.
Carter put it away in the seventh with his home run to left off Carter Capps.
The Mariners called up LHP Bobby LaFromboise from Triple-A Tacoma and optioned LHP Lucas Luetge to their top farm team. Wedge said the move was necessary because of the strain on the pitching staff after Tuesday's loss. "It was nothing in regard to Lucas. He has options. He threw three innings (Tuesday) and we needed another arm," Wedge said. ... OF Casper Wells, beaten out for the final Mariners roster spot in spring training by Jason Bay, was claimed off waivers by Toronto. ... Michael Morse, tied for the big league lead with six home runs, was rested. ... Astros RHP Alex White, a candidate for the rotation until a March 29 arm injury, will undergo Tommy John surgery Thursday. ... Seahawks coach Pete Carroll was in attendance behind home plate.