Philadelphia, PA (SportsNetwork.com) - The Marlins scored four runs on errors and another on a balk, and that was all they needed to stop a five-game skid.

Jarred Cosart threw six quality innings and Miami beat the Phillies 6-1 in the middle installment of a three-game series.

Cosart (1-1), a Phillies draft pick in 2008, gave up just four hits and one run on a Cody Asche homer to pick up his first victory of the season.

"He turned it up a notch and took it to the next level," Marlins manager Mike Redmond said of his starter. "He kept their hitters in check."

Adeiny Hechavarria went 2-for-4 and scored the go-ahead run when Luis Garcia (1-1) was called for a balk in the seventh inning.

Cole Hamels remained winless on the year despite tossing six solid frames. The left-hander scattered five hits and three walks, and the only run he allowed came as a result of his error in the second inning.

Chase Utley fielded a grounder in the hole and threw to Hamels covering first. Hamels missed what would have been the last out, and Marcell Ozuna scored the game's first run.

Asche led off the bottom of the frame by sending a payoff pitch into the right-field seats, and it stayed 1-1 until the seventh.

Hechavarria and Dee Gordon both reached on infield singles to put runners on the corners, and Gordon danced off first base and distracted Garcia, who stopped mid-motion and was called for a balk to force in a run.

Ken Giles appeared to get out of the eighth when he got Jeff Baker to bounce into what should have been an inning-ending fielder's choice, but Utley dropped the routine force out at second to load the bases

Gordon, who turned 27 on Wednesday, followed with a deep fly ball to center that turned Odubel Herrera around at the warning track. Herrera got under it, but the ball glanced off his glove. All three runners scored on the error, and Martin Prado tacked on an RBI double to cap the four-run inning.

"We don't make those errors, especially the routine ones," Hamels said. "Hopefully we can move on."

Game Notes

The Marlins improved to 3-9 against NL East clubs ... Miami won despite going 2-for-14 with runners in scoring position ... Dustin McGowan will start for Philadelphia in the series finale on Thursday. McGowan is taking the rotation spot of Sean O'Sullivan, who was placed on the 15-day disabled list with left knee tendinitis ... David Phelps will pitch for the Marlins.