Hiura homered and drove in three runs, Lyles turned in another strong start and Milwaukee snapped St. Louis' six-game winning streak with a 4-1 victory Wednesday.
The Cardinals had won 15 of 18, including two at Miller Park this week in matching their longest winning string of the season.
The Brewers ended a three-game skid. Third in the division, they trail the Cardinals by 5 1/2 games.
"We needed a win," Brewers manager Craig Counsell said. "We played a nice game, but we would have taken any kind of win."
Milwaukee got off to a fast start against Jack Flaherty (8-7), who had given up a total of just one run in his previous five starts.
Trent Grisham led off the first inning with a single, went to third on a throwing error by second baseman Kolten Wong and scored on a groundout by Hiura. Milwaukee made it 2-0 in the second when Ryan Braun doubled and later scored on Orlando Arcia's sacrifice fly.
Hiura hit a solo home run in the fourth, sending a 3-0 fastball from Flaherty into the left-field seats. Hiura added an RBI double in the eighth.
"It was big. Salvage the series, get the last win, and take it into the off-day," Hiura said.
Lyles (9-8), acquired from Pittsburgh in a trade on July 29, set the tone for Milwaukee. The right-hander, who had held Arizona hitless in a six-inning outing in his last start, struck out five of the first seven Cardinals he faced. He fanned nine in 5 1/3 innings.
Molina hit two singles and went 7 for 11 in the series. He homered three times in the first two games -- the veteran catcher has just seven home runs this season.
"We can't ignore the fact that that's a lot of games in a row and we played really well the whole stretch," said Cardinals manager Mike Shildt, noting his team had played 16 games in a row without a day off. "This group likes to play, though. This group will play in a back field or a parking lot, if that's where you tell us to play."
Wong hit his 10th homer, connecting in the sixth off Lyles. He also doubled and singled.
"To expect a sweep at this level is tough," Wong said. "Getting them is amazing, but winning series, that's the No. 1 goal."
Christian Yelich singled and walked in four plate appearances. The reigning NL MVP hasn't hit a home run in 10 games, his longest drought of the season for Milwaukee.
Cardinals: Wong returned to the starting lineup. He had not started for three games after fouling a ball of his right big toe Saturday. "You get your toenail drilled to release blood, that can't feel real great," Shildt said. "I appreciate and respect, and it is very important, his mentality to want to stay and get back to competition."
Brewers: 3B Mike Moustakas said there is no timetable for his return. He has been out since leaving Monday's game in the third inning with pain in his left palm and wrist after being struck by hard-hit groundball.
Cardinals: A three-day, four-game series against the Reds starts Friday in St. Louis. Cardinals RHP Dakota Hudson (13-6, 3.47 ERA) faces Reds RHP Trevor Bauer (10-11, 4.34 ERA) in the opener. Saturday features a day-night double-header.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
MLB Playoffs 2020: Why New York Yankees-Tampa Bay Rays ALDS could be series of the postseason
Elite pitching. Power bats. And a history of bad blood. Here's why two AL East rivals facing off with an ALCS spot on the line will be a must-see event.
Seager homers, Dodgers edge Brewers 4-2 in wild-card opener
Mookie Betts had two hits and an RBI, Corey Seager homered and the Los Angeles Dodgers beat the Milwaukee Brewers 4-2 in the opener of their NL wild-card series on Wednesday night.
Wild Card Wednesday Takeaways: Reaction to all eight MLB playoff matchups
New York knocked out Cleveland in a wild one, the Braves won in style, and the Twins and Jays are gone. Here's all the info on MLB's eight-game frenzy.
Three questions for Cleveland Indians after being eliminated from MLB playoffs
After being eliminated from the playoffs, Cleveland faces some big questions, with Francisco Lindor front and center.
Milwaukee Brewers' Ryan Braun leaves Game 1 loss early with mild back discomfort
The Brewers' Ryan Braun appeared to injure his back when he banged into a wall after catching a deep fly ball to end the second inning of Milwaukee's loss Wednesday night.
Plenty of unknowns heading into White Sox-A's Game 3
The Chicago White Sox and host Oakland Athletics will play a deciding third game in their American League first-round playoff series Thursday afternoon. That much is known.