ST. LOUIS -

Allen Craig hit an RBI single with two outs in the 10th inning and the St. Louis Cardinals beat the Milwaukee Brewers 5-4 Sunday to avoid a three-game sweep.

The Brewers tied it in the ninth on Norichika Aoki's two-out, two-run homer off closer Jason Motte. The two-strike drive barely cleared the right-field wall.

Matt Carpenter singled with one out in the St. Louis 10th off Kameron Loe (6-5) and moved up on a wild pitch. Craig singled and Carpenter made a nifty slide to score.

The Cardinals ended a three-game skid and held their slim lead for the second NL wild-card spot.

Milwaukee, which has won 15 of 20, was trying to reach the .500 mark for the first time since April 24.