Alfonso Soriano, who hit 26 home runs last year, tied it for the Cubs with his first of the season leading off the ninth against Jason Motte (2-1).
Matt Carpenter's second homer in four games off James Russell had put the Cardinals up in the eighth.
The Cubs scored three runs in the first, and there were later four ties before the Cardinals won.