Cole Gillespie drove in two runs with a single and a sacrifice fly as the Cubs earned their fourth win in 20 home games since the All-Star break. Castro, Junior Lake, Wellington Castillo and Darwin Barney had two hits apiece.
Castro drove a 1-0 fastball from Zach Miner (0-1) to the center field batter's eye for his eighth homer. The leadoff drive through a steady wind was his first homer since July 31 against Milwaukee.
Michael Young collected three more hits for Philadelphia, which has split its last six games. Young went 4 for 5 in the Phillies' 6-5 victory in Friday's series opener and is batting .588 (10 for 17) in four games against the Cubs this season.
Kevin Frandsen homered for the second straight day, giving him five on the year, but Philadelphia dropped to 9-7 under interim manager and former Cubs second baseman Ryne Sandberg.
Carlos Villanueva (3-8) pitched 1 1-3 innings for the win and Kevin Gregg got three outs for his 28th save in 33 chances. Five Cubs relievers combined for four innings of two-hit ball.
It turned into a battle of the bullpens after left-handers Cliff Lee of the Phillies and Chris Rusin of the Cubs each allowed three runs, two earned, in five innings.