MIAMI - The nature of Darnell Sweeney's first major-league hit was especially fitting, given the player he was traded for just three nights before.

Although it wasn't a grand slam like Chase Utley's first hit in April 2003, Sweeney's pinch-hit solo shot sparked the Phillies' come-from-behind, 4-2 win against the Miami Marlins on Saturday night. The estimated 445-foot home run at Marlins Park accounted for the first of the team's two, two-out runs that tied the game in the eighth inning.

Aaron Altherr and Darin Ruf smacked back-to-back solo home runs in the ninth off Marlins closer A.J. Ramos to put the Phillies ahead. Incredibly, it was the first time the team hit back-to-back home runs since July 1, 2014, also in Miami. Altherr's long ball was his second in three starts since his promotion Tuesday from triple-A Lehigh Valley.

Sweeney, a 24-year-old utility player who joined the team Thursday, became the first Phillies player whose first big-league hit was a pinch-hit home run since Marlon Anderson in 1998. He offered at the first pitch he saw, an 84-m.p.h cutter, from Justin Nicolino. It was the first and only run the Phillies scored off the Marlins' 23-year-old lefthander. Before Sweeney's big swing, Nicolino had permitted only three hits and one walk through 72/3 innings.

"It was definitely a good feeling," said Sweeney, who was playing only about a 20-minute drive from his childhood home in Hollywood, Fla., and had about 15 family and friends in the stands. "I put a good swing on a good ball, and the ball carried out."

Sweeney will make his first major-league start in the series finale Sunday, Phillies interim manager Pete Mackanin said. It will come as the team's centerfielder. Odubel Herrera will get a rare day off.

"He crushed that ball," Mackanin said. "He won a starting job [for Sunday]."

Following the home run, which landed just to the left of the giant Marlins Park sculpture in left-center field, Sweeney's new teammates greeted him in the dugout with the silent treatment. He hopped through the dugout high-fiving the air before Jeff Francoeur initiated a slew of congratulatory high-fives.

Marlins all-star second baseman Dee Gordon, one of Sweeney's friends from when both were in the Los Angeles Dodgers organization, jokingly tried to sell the home run ball back to Sweeney even though Gordon didn't have it.

"He's a character," Sweeney said. "He was saying five Gs for it."

The ball was waiting in Sweeney's locker stall upon his return to the clubhouse.

Cesar Hernandez followed Sweeney's home run with a single that chased Nicolino from the game. Andres Blanco tied the score with a double off Bryan Morris. The back-to-back homers from Altherr and Ruf in the ninth set the stage for Ken Giles' ninth save.

The comeback ensured no-decisions for both Nicolino and Aaron Harang, who put forth one of his better outings in an otherwise-woeful last 21/2 months.

Harang allowed only two hits, which tied a season-best, over seven innings. The 37-year-old righthander salvaged a solid start after an inauspicious first three innings. He worked around a four-walk night by retiring the final 13 Marlins he faced.

A three-walk inning abetted the Marlins' two-run third. With the bases loaded, each on a free pass, Derek Dietrich smoked a first-pitch change-up off the right-field wall to score Gordon and Ichiro Suzuki. Dietrich was the last Marlin Harang permitted to reach base.

Harang finished seven innings despite throwing 65 pitches through the first three. He needed 45 pitches to sail through his last four.