MIAMI -- Entering Thursday night, the Philadelphia Phillies were 1-40 when trailing after eight innings.
Make that 2-40 now.
Tony Gwynn Jr. led off the ninth with a walk against Miami closer Steve Cishek and later scored, Ben Revere added the go-ahead run when Miami second baseman Donovan Solano bobbled a potential double-play grounder and the Phillies rallied past the Marlins 5-4 Thursday night to snap a six-game losing streak.
"We basically took what they gave us," Phillies manager Ryne Sandberg said. "As they gave us bases our guys were alert and had the speed on the bases to get into scoring position and then it was just balls in play and avoiding strikeouts and making something happen."
Revere had two hits for the Phillies, who won for the third time in 13 games. It was Revere's sixth multi-hit game in his last eight outings.
It was back-and-forth all night, the last swing going Philadelphia's way: The Marlins led 2-0, the Phillies went up 3-2 and the Marlins scored two in the eighth, grabbing a 4-3 lead on Jeff Baker's pinch-hit triple.
But in the ninth, Cishek gave the Phillies a chance, and they took advantage.
"I just made things more difficult than they needed to be," said Cishek, who was 18 for 19 in save chances entering Thursday. "And the end result kind of showed right there."
Gwynn went to third on a single by Revere and wound up scoring the tying run on a grounder by Jimmy Rollins. Chase Utley then hit another grounder to Solano, who only had the play at first and allowed Revere to score easily.
Marlins manager Mike Redmond didn't speculate about what Solano's bobble meant, saying the inning's biggest mistake was the free pass Cishek (4-4) issued to Gwynn.
"He walked the leadoff guy," Redmond said. "So after that, I don't think it matters."
Phillies closer Jonathan Papelbon got his 19th save in 21 chances. Jake Diekman (3-2) got the win despite a shaky eighth, giving up two runs and costing Philadelphia the lead.
"Good thing is we didn't get swept, we were able to get a win," Gwynn said. "Hopefully it will propel us into some more. Getting swept is a bad feeling and then having to get on a plane after that is even worse."
Marcell Ozuna had three hits and scored twice for Miami, and Christian Yelich also had a two-hit night for the Marlins. Casey McGehee extended his hit streak to 10 for Miami, reaching base for the 27th straight game.
Cameron Rupp had a two-run, two-out, full-count double off Miami reliever Chris Hatcher to highlight Philadelphia's three-run sixth. Rupp was batting .125 before his opposite-field hit sailed over Giancarlo Stanton's head and off the right-field wall.
Phillies starter Kyle Kendrick gave up six hits and struck out four in seven innings, leaving with a 3-2 lead. Marlins starter Brad Hand gave up three singles to open the sixth and was chased after 99 pitches, the fourth-most of his career.
Hand's sacrifice bunt -- his first RBI in nearly three years -- allowed Ozuna to score Miami's first run in the second. Ozuna singled and scored again in the fifth, Yelich driving him in that time for a 2-0 Miami lead.
Through two innings, Hand had thrown 47 pitches, Kendrick 20. ... The Phillies lead the season series 7-6. ... Nathan Eovaldi (5-3, 3.71) starts for Miami at St. Louis on Friday against Lance Lynn (8-6, 3.38). The Phillies will send Roberto Hernandez (3-7, 4.26) to the mound in Pittsburgh against Gerrit Cole (6-4, 4.02). ... Both teams have played 85 games this season. The Marlins were 32-53 at this point in 2013, the Phillies were 41-45. ... The wife of Marlins pitcher Tom Koehler gave birth to a daughter Thursday, Redmond said.