PITTSBURGH — Jose Urena's start Sunday had little resemblance to his previous outing.

Urena allowed two runs and four hits in six innings, and the Miami Marlins rallied past the Pittsburgh Pirates 3-2 to complete a three-game sweep.

Christian Yelich homered in the first inning and Miami added a pair of unearned runs in sweeping a series for the sixth time this season. Urena (2-4) bounced back after allowing a five-run first inning at Cincinnati on Tuesday.

"This is a different game and a different day, too," the 24-year-old right-hander said. "You're going to face different hitters, so you go out there and face these hitters because you know you can do the job."

Urena lowered his ERA from 6.80 to 6.33

"He kept the ball down today," Miami manager Don Mattingly said. "They were aggressive early, swinging the bats. He had that one inning in there where he got himself into trouble. Other than that, he was good all day."

Fernando Rodney completed the five-hitter, working around a two-out walk in the ninth. Rodney retired Francisco Cervelli on a game-ending groundout for his third save of the series and 24th in 26 chances this season.

Miami went 6-1 this year against the Pirates and moved ahead of Pittsburgh in the NL wild-card race. The Marlins (65-59) trail St. Louis (66-57) by 1 1/2 games for the NL's second wild card.

Wearing 1970s throwback uniforms and caps, the Pirates (62-59) dropped 1 1/2 games back of Miami. They had won six of seven coming into the series.

"It's a snapshot of the way a baseball seasons goes," Pittsburgh manager Clint Hurdle said. "You go out on the road and go 5-1, then you come home and get swept in a series in which you have a chance to win each game. All you can do is come back and keep playing."

Ryan Vogelsong (2-3) gave up three runs and three hits in six innings.

Miami, just 12-19 at PNC Park over the previous decade coming on, went ahead on Yelich's 15th home run. He has five in 12 games at PNC Park and 30 in 438 major league games elsewhere.

Pittsburgh took a 2-1 lead in the fourth. With runners at second and third, David Freese hit a bouncer off the glove of third baseman Martin Prado for an error and Josh Bell following with a sacrifice fly.

Miami went back ahead in the fifth without hitting a ball out of the infield. Adeiny Hechavarria reached leading off on a throwing error by shortstop Sean Rodriguez and scored on Prado's RBI groundout. Dee Gordon reached on a bunt single, stole second, took third on Prado's grounder and came home when Vogelsong bounced a wild pitch past catcher Eric Fryer.

RAMOS BACK

Miami All-star closer A.J. Ramos, who had been on the disabled list with a finger injury, was activated and pitched a perfect eighth. Reliever Brian Ellington (0.92 ERA) was optioned to Triple-A New Orleans.

TRAINER'S ROOM

Pirates: RHP Tyler Glasnow (shoulder) is slated to throw four innings and 65 pitches in a rehabilitation start Monday at Double-A Altoona. Glasnow has been on the disabled list since July 24. ... General manager Neal Huntington said the team will continue to monitor rookie RHP Jameson Taillon, who missed 2014 because of Tommy John surgery and 2015 due to a sports hernia. He has thrown 127 2/3 innings with the Pirates and at Triple-A this season. "Our goal is to get him in the position to go deep into October," Huntington said. "At the same time we don't want to leave pitches in the bank."

UP NEXT

Marlins: Miami hosts the defending World Series champion Royals beginning Tuesday, the second time Kansas City has played in South Florida. Andrew Cashner (4-9) makes his fifth start for Miami.

Pirates: Taillon (3-2) is to start Monday against the former division rival Houston, which will be playing the Pirates for the first time since 2013.