Philadelphia Phillies' Maikel Franco follows through after hitting an RBI-single off Pittsburgh Pirates relief pitcher Justin Wilson during the seventh inning of a baseball game, Tuesday, Sept. 9, 2014, in Philadelphia. Philadelphia won 4-3. (AP Photo/Matt Slocum)

Maikel Franco hit a tie breaking single in the seventh inning to lift the Philadelphia Phillies to a 4-3 victory over the Pittsburgh Pirates on Tuesday night.

Freddy Galvis homered, doubled and scored the go-ahead run after an infield single and a stolen base. Justin De Fratus (3-1) pitched a scoreless inning for the win. Jonathan Papelbon finished for his 36th save in 39 chances.

The Pirates entered the night with a 1 1/2-game lead over Atlanta and Milwaukee for the second NL wild card. The last-place Phillies have won 10 of 15.

Galvis led off the bottom of the seventh with a grounder to deep shortstop for a single off Justin Wilson (3-4). After a pair of strikeouts, Galvis stole second. He scored on Franco's hit to right.

Galvis hit a drive way out to right to tie it at 3 in the fifth.

The Pirates lost a run after a video review showed that a fan reached over the fence and touched Starling Marte's drive to left-center in the fifth. Marte was awarded a double instead of a homer and was stranded at third.

The Phillies took a 1-0 lead in the first on Chase Utley's RBI single. Franco hit a popup to shallow right that fell for a double when second baseman Neil Walker couldn't see it in the lights.

Jordy Mercer's RBI double in the second tied it at 1. Russell Martin hit a two-run double to right, giving the Pirates a 3-2 lead in the third.

Phillies starter David Buchanan helped himself with an RBI single after Galvis hit a double off the right-field wall in the second.

Buchanan allowed three runs — two earned — and four hits in six innings.

Pirates starter Edinson Volquez gave up three runs and six hits in six innings.

(Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)