Votto's two opposite-field shots off Cardinals starter John Lackey provided Cincinnati's first four runs, and Hamilton tagged up and scored on Todd Frazier's shallow sacrifice fly to right field for the go-ahead run in the eighth.
Jordan Walden (0-1) took the loss after walking Hamilton, allowing him to steal second and seeing him advance on a wild pitch. Lackey exited after allowing four runs on four hits and two walks in six innings with a strikeout.
The Cardinals outhit Cincinnati, 10-4, including a two-run home run from Randal Grichuk and Jason Heyward's game-tying single in the seventh.
Jason Marquis, who had not appeared in a major league game since 2013, allowed three runs in six innings with seven strikeouts. J.J. Hoover (2-0) struck out three in 1 1/3 innings of relief, and Aroldis Chapman fanned two to earn his second save.