Gyorko's 393-foot shot to left field with Chris Denorfia and Wil Venable abroad gave San Diego a lead it wouldn't relinquish, and the Padres went on to take a second straight from the Pirates.
The San Diego second-baseman finished 3-for-5 with two runs scored while Ronny Cedeno chipped in with three hits for the Padres.
Eric Stults (9-13) went five innings to notch the win, allowing two runs on seven hits.
Pirates starter Jeff Locke (10-6) surrendered four runs on seven hits in a five-inning stint.
Marlon Byrd drove in both runs for Pittsburgh, which came into the contest tied with St. Louis atop the National League Central.
Jordana Brewster on Paul Walker: 'He was an enormous presence in my life'
Benedict Cumberbatch's dramatic reading of R. Kelly lyrics is just what you need