PHILADELPHIA — Sean Rodriguez is having his most productive big league season yet, and he had a memorable blast Tuesday night to keep the Pittsburgh Pirates’ slim postseason hopes alive.

Rodriguez had a pinch-hit three-run homer in the ninth inning, lifting the Pittsburgh Pirates over the Philadelphia Phillies 5-3 on Tuesday night.

Pittsburgh remained six games behind the Mets for the second NL wild card.

Rodriguez’s home run was his career-high 13th of the season and first since Aug. 14. It was also his first pinch-hit home run since May 25, 2013.

“A couple years ago, yeah I was driving the ball, but I wasn’t necessarily putting the ball in play enough,” Rodriguez said. “This year, I’ve been able to do that.”

Rodriguez hit for pitcher Felipe Rivero (1-5) with two on and one out and drilled a 2-2 pitch from reliever Jeanmar Gomez (3-4) into the second row of seats in right field.

“It was a tough day for me,” Gomez said. “It was a slider that was up. Some of my pitches were flat.”

Rodriguez put the Pirates ahead after Francisco Cervelli reached on a walk and Jordy Mercer doubled off Gomez.

Tony Watson struck out two in the ninth for his 12th save.

Playing in just his third major league game, left fielder Roman Quinn had two hits and scored a go-ahead run in the eighth on Freddy Galvis’ sacrifice fly.

Pirates right-hander Ivan Nova entered 5-0 since being acquired from the New York Yankees on Aug. 1. He allowed two runs and five hits while recording a season-high 11 strikeouts but left the game in the seventh after throwing 92 pitches.

Nova missed the chance to become the second Pirates pitcher to go 6-0 in his first eight starts.

“I was getting ahead in the count and I threw some good sinkers and that was a good thing for me,” Nova said. “They’re an aggressive team and they were out there swinging.”

Phillies right-hander Alec Asher allowed two runs and four hits in 6 1/3 innings.

Pirates manager Clint Hurdle was ejected for the sixth time this season and the 51st time in his managerial career in the sixth inning. Hurdle vehemently argued with first-base umpire Alan Porter over a call that resulted in Ryan Howard beating out a double-play grounder to bring in the go-ahead run for Philadelphia.

The night was a mixed bag for Pirates rookie second baseman Adam Frazier, who gave Pittsburgh a 1-0 lead with an RBI single in the third inning but was thrown out trying to stretch it into a double. Josh Bell followed with a double that would have scored Frazier.

Frazier also botched a fourth-inning grounder by Howard that tied the score at 1, had an errant throw on a potential double-play grounder by Maikel Franco that gave the Phillies a 2-1 lead in the sixth and grounded out with the bases loaded to end the seventh with the score tied 2-2 after Jung Ho Kang scored on a wild pitch.

TRAINER’S ROOM

Pirates: Pittsburgh placed right-hander Gerrit Cole on the 60-day disabled list due to inflammation in his right elbow. Cole returned Monday from a two-week stint on the DL and allowed five runs, four hits and walked four in two innings. He finishes the season with a 7-10 record and 3.88 ERA in 21 starts. … LF Starling Marte, who leads the NL with 17 outfield assists, sat out his eighth straight game with back spasms and was replaced by Matt Joyce.

UP NEXT

Pirates: LHP Steven Brault (0-2, 3.38 ERA) will make his sixth career start when the series resumes Wednesday night. The 24-year-old has received just five runs of support in his five previous starts.

Phillies: RHP Jake Thompson (1-5, 6.05 ERA) will make his eighth start of the season. The 22-year-old is looking for his first win since Aug. 12.