Updated

Giancarlo Stanton finally seems to be finding his home run stroke.

After blasting his first of the season on Saturday, Stanton sent two more over the fence on Sunday to help the Miami Marlins take a 6-4 victory over the Chicago Cubs and salvage the finale of a four-game set.

Stanton, who was batting just .200 with three RBI coming into the series, was a perfect 3-for-3 with four RBI and three runs scored to help the Marlins avoid being swept in a series for the third time this season.

"Obviously, we were on the verge there of getting swept, but like I've said all along, these guys have done a great job of coming everyday to play," said Marlins manager Mike Redmond.

Nick Green added a solo homer and Donovan Solano added an RBI in just the second win in eight games for Miami. Ricky Nolasco (2-2) was solid over seven innings of work, yielding three runs on four hits.

The Cubs were searching for their first four-game series sweep since Aug. 4-7, 2011, but Carlos Villanueva (1-1) lost the lead in the sixth and Chicago never went back in front. Villanueva struck out eight and surrendered four runs on four hits and three walks.

"I thought we played a good series here," said Villanueva. "Obviously we wanted to go home with a sweep, but we still feel like we're starting to play better and hopefully we can keep it going."

Starlin Castro went 2-for-4 with two RBI for Chicago. Anthony Rizzo had an RBI double among his two hits and Dioner Navarro hit a solo homer in the setback.

Villanueva had retired 14-of-15 batters after giving up a two-run homer to Stanton in the first and the Cubs led 3-2 after five innings, but Villanueva ran into trouble in the sixth.

Juan Pierre reached with a one-out single, stole second and came around to tie the score on Stanton's base hit into left. After Greg Dobbs was intentionally walked, the Marlins grabbed the lead when Solano ripped a line drive past the glove of Castro at short.

Green and Stanton pushed the Marlins' lead to 6-3 after each hit a solo shot in the seventh and eighth innings, respectively.

The Cubs had a chance in the top of the eighth after putting runners on first and second with one out, but couldn't push a run across. Alfonso Soriano lined out and pinch-hitter Scott Hairston flew out to short left.

Marlins closer Steve Cishek gave up a solo homer to Navarro to start the ninth, but then retired the next three batters in order to pick up his third save.

Chicago struck first when Rizzo doubled home David DeJesus in the first inning, but Miami answered in the home half on Stanton's two-run blast that put the Marlins ahead.

Nolasco coughed up the lead in the third when he gave up three straight hits to begin the frame, with Castro's double down the left-field line scoring a pair of runs. Nolasco, though, didn't give up another hit for the rest of his outing.

Game Notes

The Cubs were 1-for-8 with runners in scoring position ... Pierre stole his sixth base of the season ... The Marlins will travel to New York for a three- game series with the Mets starting on Monday ... Chicago will host a four-game set with the Padres beginning on Monday.