The Padres snapped a three-game losing streak and Pittsburgh lost for the first time in four games.
The contest had been tied since the sixth, when Pittsburgh's Andy LaRoche drove in Eric Hinske from third with a single. San Diego put the potential winning run on second with one away in the 10th, but Sean Burnett escaped the jam.
Matt Capps (0-1) was not so fortunate in the 11th. After Luis Rodriguez flew out to start the inning, Burke drew a five-pitch walk. Jody Gerut then popped out to third, but Burke stole second, after which David Eckstein walked.
Giles, facing a 1-2 count after fouling off two pitches, drove a ball to deep right that was ruled a single, easily bringing in Burke from second.
That left Edwin Moreno (1-2) as the winning pitcher. He allowed a hit while working both the 10th and 11th innings.