Posey batted cleanup in manager Bruce Bochy's lineup, going 1-for-4 with a single in the eighth inning. The Giants won 4-2.
Posey missed eight games with a right hamstring injury sustained at the Baltimore Orioles on June 1.
The six-time All-Star also was out for six games in May with concussion symptoms.
Aramis Garcia was optioned to Triple-A Sacramento.
The Associated Press contributed to this report.