HOUSTON -- On a night when the Milwaukee Brewers struck out again and again, piling up a season-high 24 K's against the Houston Astros, one big swing by Mike Moustakas made all those whiffs way easier to swallow.

Moustakas hit a two-run homer during Milwaukee's three-run 14th inning, and the Brewers struck out 15 times against Houston ace Justin Verlander before rallying for a 6-3 victory over the Astros on Wednesday.

Christian Yelich started the 14th with a single against rookie Cionel Perez (1-1) for Milwaukee's first hit since the ninth. After Ryan Braun lined out, Moustakas hit a drive to right for his 21st homer.

"Obviously, 24 punchouts isn't what we were looking for, but ... we got a W so we turned a negative into a positive and found a way to win against a great ballclub over there," Moustakas said.

Jesus Aguilar added a pinch-hit RBI single as Milwaukee won for the fifth time in six games. Braun, Yasmani Grandal and Eric Thames also went deep for the Brewers, and Adrian Houser (2-1) pitched two scoreless innings for the victory. "I bet you there's not too many times a team struck out 24 times and won the game," Yelich said. "All those weird baseball things happen and that's another example of it. Honestly, it's just a really good win and a hard-fought win."

Verlander set a career high for K's while allowing three runs in seven innings. The 2011 American League Cy Young Award winner led the way as Houston set a franchise record for strikeouts, surpassing its previous record of 23 during a 15-inning game on May 31, 2003, against the Chicago Cubs.

Verlander joined Randy Johnson as the only pitchers in Astros history with at least 15 strikeouts and no walks in a game, according to ESPN Stats & Information research. (Johnson had 16 strikeouts against the Pittsburgh Pirates on August 28, 1998.)

"It would feel a lot better if we won," Verlander said. "Yeah, cool, great, but we didn't win the baseball game."

Houston had a 3-2 lead before Thames connected in the seventh inning for Milwaukee's third homer off Verlander. It was Thames' ninth of the season.

Each team had late chances to go in front.

Jake Marisnick singled off Houser with one out in the 13th. Marisnick stole second base, but Houser retired Josh Reddick and Alex Bregman to end the threat.

Pinch hitter Myles Straw walked leading off the Houston 10th, but was caught trying to steal second base. He was initially called safe, but the Brewers challenged the call and it was overturned. Josh Hader walked Tyler White, but Marisnick grounded into a double play to end the inning.

"Hitting is hard. They threw some pretty good arms at us," Astros manager AJ Hinch said. "They're a good team, and yes, it doesn't feel good when you go quietly like that."

Singles by Yelich and Moustakas left runners at first and third with one out in the ninth. But Roberto Osuna struck out Grandal and Thames to escape the jam.

Verlander surrendered solo drives to Braun in the first and Grandal in the second before settling into a groove. He retired 17 of 18 after Grandal's 15th homer, with Milwaukee's only baserunner coming on a double by Thames to start the fifth.

Verlander, who had fanned 14 four times in his career, struck out eight of his final 10 batters, including the side in the sixth.

Milwaukee's Brandon Woodruff also yielded three runs and four hits in seven innings.

The Brewers led 2-0 before the Astros scored three times in the fourth. Robinson Chirinos singled in Yuli Gurriel before Tony Kemp doubled in two runs.

ANNIVERSARY

Verlander got the start on the 12th anniversary of his first career no-hitter, a 4-0 victory over Milwaukee. Brewers manager Craig Counsell led off in that one and finished 0-for-4 with two strikeouts.

TRAINER'S ROOM

Brewers: RHP Jhoulys Chacin (lower back strain) will come off the injured list to start against San Diego on Monday.

Astros: 2B Jose Altuve (leg fatigue) and OF George Springer (hamstring) are both improving, and Hinch said they could start rehabilitation assignments sometime this weekend. ... C Max Stassi (knee soreness) is scheduled to begin a rehabilitation assignment Thursday.

DYNAMIC DUO

Yelich and Moustakas each had two hits. Yelich extended his hitting streak to 10 games, which is the longest streak for the Brewers this season, and Moustakas has hit safely in 10 of the past 11 games.

UP NEXT

Brewers: Milwaukee is off Thursday before Zach Davies (7-0, 2.41 ERA) starts Friday night in the opener of a three-game series at San Francisco. Davies allowed three runs in five innings in a 5-3 win over Pittsburgh in his most recent start.

Astros: Following an off day, Houston hosts Toronto on Friday in the first of three games. Gerrit Cole (5-5, 3.72 ERA) is scheduled to start. Cole yielded three runs -- one earned -- and struck out a season-high 14 in seven innings but did not factor in the decision in a 4-3 win over the Orioles in his previous start.

The Associated Press contributed to this report.