The Cardinals rallied with two outs in the fifth to regain the lead at 2-1 at Busch Stadium.
The Milwaukee Brewers pulled even at 1-1 when Orlando Arcia led off fifth inning with a solo shot to center field.
It was just the second hit of the game for the Brewers against righthander Daniel Ponce de Leon.
Cain kept it 1-0 when he ran down a Kolten Wong drive into the gap in right center to end the inning.
The visiting Brewers nearly scored in the first inning when Braun blooped a two-out single to right center.