MILWAUKEE — The Brewers seemed to make more mistakes than contact Monday night.

Jonathan Villar let in the winning run with a throwing error and Milwaukee set a franchise record for a nine-inning game with 19 strikeouts, allowing the St. Louis Cardinals to escape with a 6-5 victory.

With two on and two outs in the ninth inning, Yadier Molina dropped down a bunt. Tyler Thornburg (5-5) went to third for a force out, but Villar’s throw to first base was wild, allowing Stephen Piscotty to score from second.

“He just made a bad throw,” Brewers manager Craig Counsell said. “We talked about that situation out there and the possibility for a double play. He just rushed it a little bit probably. The big out was to get the out at third. We just didn’t make the play.”

It was Villar’s 25th error of the season and his eighth since moving from shortstop to third base to accommodate rookie Orlando Arcia.

“Put pressure on them,” Cardinals manager Mike Matheny said. “That’s it. Make them make plays.”

After being swept in a four-game series by Pittsburgh over the weekend, the Brewers squandered a chance to win the series opener with St. Louis.

Carlos Martinez struck out a career-high 13 over six innings, with the Brewers only mustering a run on an RBI single by Scooter Gennett in the sixth.

“I really tried working hard on my breaking ball and that’s what I tried to stay focused on,” Martinez said through a translator. “I didn’t do anything different. I know that the balls can go far (in Miller Park), and I know that they’re looking for a four-seamer, so I just try to switch it up and confuse them.”

Once Martinez left the game, Milwaukee rallied for four runs in the seventh to take a 5-3 lead.

Arcia led off the inning with a solo shot off Matt Bowman. Villar added an RBI double and Gennett gave the Brewers the lead with a run-scoring infield single.

However, Milwaukee squandered a chance to extend its lead. After Kevin Siegrist walked Hernan Perez to walk in a run, Miguel Socolovich (1-0) came on to strike out Chris Carter and get Kirk Nieuwenhuis to pop out to shortstop.

Corey Knebel then surrendered just his second home run of the season, a two-run blast to Randal Grichuk in the eighth.

Villar’s error wasn’t the only costly defensive blunder by the Brewers, as catcher Martin Maldonado botched a run down in the fourth inning that led to a run.

“You have to do a lot of things right against these teams,” Counsell said. “We did a nice job coming back, especially with how Martinez threw the ball the first six innings. There’s a sliver lining that we’re still fighting, for sure, but winning games against these teams … it’s not easy.”

Jedd Gyorko and Kolten Wong each hit solo home runs off Brewers starter Zach Davies. The right-hander matched a career high with nine strikeouts but allowed three runs over 6 1/3 innings.

“It was good to get back to a four-pitch mix,” Davies said. “I was trying to get early outs in the early innings. So from that standpoint, I was happy with (my outing).”

TRAINER’S ROOM

Brewers: Brewers RHP Junior Guerra (right elbow) will return from the disabled list to start Friday in Pittsburgh.

UP NEXT

Cardinals: RHP Adam Wainwright (9-8, 4.67 ERA) will look to continue his career dominance of the Brewers on Tuesday. The veteran is 13-8 with a 2.23 ERA in 33 games against Milwaukee.

Brewers: RHP Wily Peralta (5-9, 5.87) will make his 18th start of the season when he faces the Cardinals on Tuesday. Peralta is 1-2 with a 3.52 ERA in four starts since being recalled from Triple-A Colorado Springs on Aug. 8.