ST. LOUIS — Matt Carpenter doesn't mind some small ball now and then, and takes pride in his bunting.

That said, wasn't too upset about failing to get one down in the 11th inning Tuesday night.

Two pitches after botching a bunt attempt, Carpenter hit a two-run homer with no outs to lift the St. Louis Cardinals over the Milwaukee Brewers 5-3.

"I was trying to beat out a bunt," Carpenter said. "I'm glad it didn't work."

Carpenter ripped a pitch from J.J. Hoover (0-1) down the right field line for the third game-ending homer of his career. It capped a night in which St. Louis rallied from one-run deficits in the ninth and 10th innings.

"There's always a win every year that kind of jumpstarts you," Carpenter said. "We haven't been playing bad, but we haven't been clicking like we know we're capable of. This might be the game that gets us on a roll."

Domingo Santana singled in Eric Thames to put Milwaukee ahead 2-1 in the ninth inning, but Tommy Pham scored from second on a pair of wild pitches by Jacob Barnes to tie it in the bottom of the inning.

After Orlando Arcia singled in a run in the top of the 10th, Greg Garcia made it 3-3 with his own RBI single a half-inning later.

Garcia was 0 for 7 this season before coming up with hits in the seventh and tenth innings.

"I wasn't panicking," Garcia said. "It's tough, those o-fers add up. It's good to get that first one out of the way."

Dominic Leone (1-2) pitched a clean 11th inning before Paul DeJong set up Carpenter's winner with an infield single.

"A number of good things happened offensively to keep us in that game," St. Louis manager Mike Matheny said. "When it got to it, guys showed a lot of grit and heart."

Eric Thames homered in the first inning for the Brewers. It was his fourth of the season and gives him 15 in April over the past two seasons.

St. Louis starter Carlos Martinez allowed a run and six hits over six innings. He stuck out four and walked two.

"Not a lot of strikeouts, but a lot of swings and ground balls," Martinez said. "I never lost my focus. I was competing."

Brent Suter held the Cardinals to a run and four hits over 5 1/3 innings.

"St. Louis is a scrappy team, they're well-balanced and they fight to the very end," Suter said.

FEELING AT HOME

St. Louis newcomer Marcell Ozuna singled in the sixth inning to extend his hitting streak to nine games. He is 15 for 40 (.375) during the run and has hit safely in his last seven games against the Brewers.

TRAINER'S ROOM

Brewers: C Manny Pina was removed in the seventh inning with tightness in his right calf. ... OF Lorenzo Cain is listed as day-to-day after bruising his Achilles tendon in a first base collision with Jose Martinez on Monday.

Cardinals: Martinez was also held out of the starting lineup due to the collision with Cain. He is day-to-day.

UP NEXT

Milwaukee RHP Junior Guerra will make his first start of the season against St. Louis RHP Adam Wainwright (0-1, 7.36) in the final game of the three-game series Wednesday. Wainwright gave up three runs in 3 2/3 innings of a 3-1 loss to Arizona on Thursday.