ST. LOUIS — The St. Louis Cardinals returned home. So did their sloppy play.

A key base-running blunder combined with subpar pitching and defense added up to a 12-5 loss to the Milwaukee Brewers on Thursday night. The Cardinals fell to 30-38 at home and dropped a half game behind the idle New York Mets for the second wild card spot.

The Cardinals’ problems began in the bottom of the second after Randal Grichuk was picked off second base by Brewers catcher Martin Maldonado. Instead of runners on first and second with no outs, the play ended a potential rally allowing the Brewers to cling to a one-run lead.

“We had a lot of things happen today that we need to clean up,” Cardinals manager Mike Matheny said. “I was preaching aggressiveness, but the pickoff, that hurt. That’s an opportunity to maybe get another big inning and to come right back and that hurts.”

Instead, the Brewers continued to pile on scoring five innings in a row including a six-run sixth.

Jaime Garcia (10-12) struggled for the fourth time in his last five starts, losing a career-high fourth straight decision. He gave up five earned runs in 3 2/3 innings — his third shortest outing of the season.

“As he came out in the first I thought it was going to be one of those days where we were going to see some really good balls on the ground,” Matheny said. “It seemed like some elevated balls got him. He had a good sinker. It just ended up being a rough one.”

Even when Garcia executed, the results backfired for the Cardinals. Garcia appeared to be on the brink of wriggling out of a fourth inning jam by striking out Junior Guerra, but strike three got past gold-glove catcher Yadier Molina allowing a run to score.

“I think when you get a lead those tack on runs are a big deal,” Brewers manager Craig Counsell said. “You keep thinking tack on single runs and after that we just broke it open.”

Garcia was charged with a wild pitch on the play. He was pulled after walking the next batter on four pitches.

“I didn’t come through,” Garcia said. “The guys scored some runs against a tough pitcher. They have a good lineup over there. Just didn’t get the job done.”

Cardinals reliever Mike Mayers retired just two of the nine batters he faced, giving up six runs. He has given up 15 runs in 3 1/3 innings and has a 40.50 ERA.

Kolten Wong’s two-run home run in the fourth was the Cardinal second baseman’s third in his last six games. Jose Martinez’s first major league hit in the eighth scored Jedd Gyorko.

Domingo Santana and Orlando Arcia hit back-to-back homers, on consecutive pitches, to get the Brewers’ bats going in the second.

Hernan Perez had four hits and three RBIs for the Brewers, who won their season-high fifth straight on the road and have won seven of their last eight games.

The bottom three hitters in the Brewers lineup reached eight times and scored six runs.

Maldonado’s two-run home run in the sixth was his first since Aug. 13.

Guerra (8-3) needed 74 pitches to get through five innings in his second start back from the disabled list. It was his first career win against St. Louis in three tries.

Garcia entered the game with an 11-5 career record against the Brewers.

“Well there are some guys who hadn’t faced him very often,” Counsell said. “He left some balls up and that’s how you’ve got to get him. You’ve got to get him with some balls up in the strike zone and we did a good job of it.”

TRAINING ROOM

Cardinals: LHP Michael Wacha (right shoulder inflammation) and RHP Trevor Rosenthal (right shoulder inflammation) both had successful bullpen sessions Wednesday. . OF Matt Holliday (right thumb fracture) grabbed a bat for the first time Thursday. . IF Aledmys Diaz (right thumb fracture) went 0-for-4 in a rehab start at Double-A Springfield on Wednesday.

UP NEXT

Brewers: RHP Jimmy Nelson (7-13, 4.36 ERA) has made 12 quality starts this season. He is 0-6 with a 7.57 ERA in eight career games against St. Louis.

Cardinals: RHP Carlos Martinez (13-7, 3.07 ERA) leads all National League pitchers with 30 double plays induced. He is 2-0 with a 0.95 ERA in three starts this season against Milwaukee.