Robert Andino hit a tiebreaking single in the top of the ninth inning, then the Miami Marlins got Andrew McCutchen to ground into a game-ending double play with the bases loaded to hold off the Pittsburgh Pirates 6-5 Friday night in a matchup of NL wild-card contenders.

JT Realmuto, who homered in going 3 for 3, drew a leadoff walk in the Miami ninth from Neftali Feliz (4-1). Realmuto moved up on a sacrifice bunt and scored when Andino lined his single into left field.

Christian Yelich and Miguel Rojas also each had three hits and a homer as the Marlins won for just the third time in nine games. The Pirates' loss was their second in eight games.

Fernando Rodney wound up with his 22nd save in 24 opportunities. He issued an intentional walk to load the bases for McCutchen, but the former NL MVP stayed stuck in a season-long slump when he bounced into a double play.