Updated

Starlin Castro's go-ahead home run in the bottom of the sixth inning lifted the Chicago Cubs to a 4-3 win over the Philadelphia Phillies in the middle test of a three-game set.

Tied at 3-3 in the sixth and with Zach Miner (0-1) pitching for Philadelphia, the leadoff man Castro hammered a 1-0 fastball to center to give Chicago the lead for good.

"Swinging the bat with a lot more authority lately and seeing him put that kind of swing on that ball with the wind blowing in, that was nice," Cubs manager Dale Sveum said.

Carlos Villanueva (3-8) threw 1 1/3 scoreless innings of relief to pick up the win while Kevin Gregg worked around a two-out single in the ninth to notch his 28th save.

Kevin Frandsen clubbed a two-out solo shot in the second to put the Phillies on the board, only for the Cubs to respond in the home half. With one out, Welington Castillo, Darnell McDonald, and Cole Gillespie hit consecutive singles, the last of which tied the game.

The Phillies went back on top an inning later. Chase Utley reached first on an error by Cubs first baseman Anthony Rizzo, swiped second and scored on a double by Carlos Ruiz.

Castillo answered in the bottom of the inning. With two out and runners at the corners, he flicked a single to right which plated Donnie Murphy.

In the fourth, Frandsen was hit by a pitch to begin the frame but was erased on Roger Bernadina's fielder's choice grounder. Phils starter Cliff Lee then reached on a grounder back to the mound which erased Bernadina at second, and scored when Young followed with a triple.

The game was deadlocked once more in the fifth. Chicago loaded the bases with one out thanks to a leadoff double from Murphy, single by Junior Lake and walk to McDonald, before Gillespie he hit a fly to center, bringing Murphy home.

"Felt like I had to battle," said Lee. "Seeing like they had a lot of long at- bats and grinded me out. Saw a bunch of pitches and battled."

Game Notes

Cubs starter Chris Rusin gave up three runs -- two earned -- on four hits and three walks over five innings ... Lee also lasted five frames, allowing three runs -- two earned -- on nine hits and three walks ... The Cubs were 3-for-10 with runners in scoring position and stranded 11 ... Lake went 2-for-4. He has 50 hits since the All-Star break, the most of any rookie ... Young went 3-for-5, improving to 13-for-26 in his last six games ... Chicago's Jake Arrieta is scheduled to face Philadelphia's Kyle Kendrick in Sunday's series finale.