Gyorko, who entered in a 3-for-28 slide, scored three runs and drove in another. Headley added two RBIs for the Padres, who have won four straight and six of seven.
Cashner (9-8) earned his first victory since Aug. 2, throwing 7 2-3 masterful innings while limiting the Phillies to four hits and a walk. He matched a season high with seven strikeouts and retired his first 11 batters before giving up a double to Chase Utley.
Cashner had allowed just one run in his previous two outings but did not get a decision in either one.
Philadelphia had won three in a row.
In the fifth, San Diego scored four runs on six singles, including five in a row to open the inning. Six hits in one inning tied a season high.
Cedeno and Kyle Blanks finished with two hits apiece.
Cody Asche hit his fifth home run in the fifth inning for the Phillies' first run. The homer was Asche's third in six games.
Phillies starter Tyler Cloyd (2-4) was not sharp in his first major league start in three weeks. The right-hander allowed seven runs and nine hits over four-plus innings. He struck out four and walked none.
In his big league debut, catcher Cameron Rupp legged out an infield single and struck out twice for Philadelphia.
NOTES: Before the game, the Padres selected the contract of infielder Tommy Medica from Double-A San Antonio. ... Phillies RHP Roy Halladay, originally scheduled to pitch Tuesday, will instead start Thursday after experiencing flulike symptoms last weekend. ... MLB's 2014 schedule was released on Tuesday. The Padres will host the Los Angeles Dodgers on opening day, while the Phillies will open the season at Texas. ... Padres closer Huston Street was selected NL player of the week Monday after earning four saves and a win. ... Cliff Lee (12-6, 3.01 ERA) pitches Wednesday for the Phillies against Eric Stults (8-13, 4.07).