San Diego right-hander Andrew Cashner, named the team's starter for the season opener earlier in the day, allowed eight runs -- four earned -- on nine hits with one walk and two strikeouts in 3 2/3 innings. He threw 94 pitches, 63 for strikes.
Cashner entered Thursday's game not having allowed a run this spring in nine innings.
"I just didn't really make a good adjustment with getting my fastball down," Cashner said. "I threw some good changeups today, but the sinker was not to be found today. I thought I took a step forward with my sliders and my changeups."
Leading 2-0, the Giants got five runs in the second inning with Posey's slam to right field being the big blow of the inning.
Posey had two hits and teammate Hunter Pence added three hits.
San Diego third baseman Chase Headley went 0-for-2 in his first Cactus League game. Headley suffered a strained right calf during an infield drill on Feb. 22. He had seven at-bats in two Minor League games on Wednesday, collecting three hits.
The Padres did all their scoring in the ninth against left-hander Javier Lopez, highlighted by Kyle Blanks' two-run homer and triples from Jace Peterson and Alexi Amarista.
Up next: Left fielder Michael Morse, having apparently nursed his right calf back to health, hopes to play Friday as the Giants oppose the Oakland A's. Morse experienced an eventful afternoon in the Cactus League opener against Oakland, as A's right fielder Josh Reddick twice robbed him of home runs. This game could be an audition of sorts for the long-relief role, as Yusmeiro Petit and David Huff, two candidates for that job, are expected to pitch. Watch the action on MLB.TV live at 6:35 p.m. PT.
Corey Brock is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.