PITTSBURGH (AP) — Adam Frazier’s pinch-hit home run in the seventh inning powered the Pittsburgh Pirates to a 5-4 victory over the Philadelphia Phillies on Sunday.

Frazier’s home run was his first in the majors. It was given up by fellow rookie Edubray Ramos, who took his first career loss to fall to 1-1. Frazier’s homer made a winner of Pirates’ reliever Neftali Feliz (4-0).

Making his second appearance since a trip to the disabled list for a fatigued shoulder, starter Jameson Taillon struck out seven batters in six innings but was also hittable at times. He surrendered four extra-base hits, including solo home runs by Odubel Herrera and Andres Blanco, which allowed the Phillies to build a 4-2 lead.

The Pirates’ comeback started in the sixth inning, when Starling Marte lead off with a double to center and then Matt Joyce sent a first-pitch fastball from Philadelphia starter Vince Velasquez 434 feet off the batters’ eye beyond the centerfield wall.

The home run was the 10th of the season for Joyce, his most since 2013 despite only having a part-time role. He is slugging a career-high .563 on the season, after posting a career-low .291 mark in 2015 with the Anaheim Angels.

Joyce also walked and scored as part of the Pirates’ two-run second inning. Marte led off the inning with a single and Elias Diaz drove him in with a groundout to record his first career RBI. Sean Rodriguez then drove in Joyce with a double to center.

The Phillies scored a pair off Taillon in the third when he gave up a leadoff single to his mound opponent, Vince Velasquez. Cesar Hernandez drove in Velasquez with a triple off the wall in center field and then came around to score on Herrera’s groundout.

Mark Melancon pitched the ninth inning to record his 30th save, the third most in the National League. He became the first Pirates pitcher to have three consecutive seasons with 30 or more. He led the big leagues with 51 saves in 2015, and his 114 saves since the start of 2014 are the most in the majors.

The 5-foot-10 Frazier was an unlikely source of fences-clearing power. The 407-foot home run was not only his first since being recalled from Triple-A Indianapolis on June 24, it also was his first home run at any level since Sept. 5, 2015, when he was with Double-A Altoona. He hit just three total minor-league home runs in the Pirates organization since being drafted out of Mississippi State in 2013.

PNC Park continues to be a problem spot for the Phillies. They dropped the three-game series, 2-1, and have now lost three consecutive series in Pittsburgh with just one win in that span. Since PNC Park opened in 2001, the Phillies are 16-31 at the home of their in-state rival.

The game was delayed an hour and 32 minutes by a thunderstorm in the bottom of the eighth inning.

TRAINING ROOM

Phillies: Blanco left the game after applying a tag on Gregory Polanco at third base in the fifth inning. Polanco was attempting to steal third. Blanco took the throw from catcher Carlos Ruiz in plenty of time and tagged Polanco, who appeared to make contact with Blanco’s hand or wrist with his foot. Blanco was replaced by Maikel Franco. It was Franco’s first action since being removed from Friday’s game after being hit by a pitch in his wrist. He went 1 for 2 at the plate. … Catcher Cameron Rupp did not play as a precaution after being hit in the head with a pitch Saturday. Concussion tests done Saturday night and before the game Sunday were negative.

Pirates: Right-handed pitcher Tyler Glasnow was placed on the 15-day disabled list before the game with right shoulder discomfort.

UP NEXT

Phillies: Jeremy Hellickson (7-7, 3.84 ERA) will start a three-game set in Miami. In his last seven starts, he’s walked just seven batters and has a 0.98 WHIP while lowering his ERA by half a run. The Phillies enter the series 9½ games behind the Marlins for the final NL Wild Card spot.

Pirates: Francisco Liriano (6-9, 4.96 ERA) will begin a two-game series against the Seattle Mariners after an off day Monday. The Pirates have rearranged their starting rotation to keep Liriano and Gerrit Cole on as close as five days of rest as possible during a stretch where they have four days off in a three-week span.

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