MIAMI Having already set the major league record for most losses of 13 or more innings in a month, the Marlins on Tuesday didn't let it get that far.

After coughing up a late two-run lead, Ed Lucas's 11th-inning RBI-single sent the Marlins to a 5-4, walk-off win over the Phillies at Marlins Park and halted a four-game losing streak. Jeff Baker, who opened the inning with a pinch-hit single off Justin De Fratus, scored the game winner.

The Marlins' 13th extra-inning game was their third in five games and seventh since June 6. They are 2-5 in those contests, five of which went at least 13 innings.

"After that many, that kind of a streak, it starts to build and to grate on you a little bit as a team," Lucas said. "It was nice to be able to finish one off. I feel like we've been so close in the past. We just haven't gotten the big hit when we needed it. It was good to dump one in there and get us out of here for once."

Kevin Gregg entered in the eighth trying to preserve a two-run lead. After retiring Chase Utley and Ryan Howard, he watched a 2-1 pitch to Marlon Byrd clank off the home run sculpture. Cody Asche followed and drilled Gregg's 1-0 offering off the yellow Miccosukee column down the right field line.

The blown save was Gregg's second in three outings. His ERA in 6 1/3 innings since joining the Marlins: 7.11.

"That eighth inning continues to be a tough inning for us to get through," manager Mike Redmond said. "I felt good with two outs, but it didn't happen. We picked each other up again and guys came in and put up some zeroes and gave our offense a chance."

Mike Dunn (one-third), Steve Cishek (one) and Bryan Morris (two) combined on the finla 3 1/3 scoreless innings. Morris, who has not allowed an earned run in 18 2/3 innings since the Marlins acquired him from the Pirates, improved to 6-0 (2-0 with the Marlins).

Since Marlins Park opened in 2012, Tom Koehler (Sept. 5, 2012) and Gregg are the only two relievers to serve up multiple homers in an outing here. Koehler allowed two to the Brewers during a two-inning stint.

The last Marlins' reliever to give up two homers while failing to record more than two outs: Matt Lindstrom against the Phillies on April 24, 2009. Gregg is the seventh member of that inauspicious Marlins' club, joining Lindstrom, Gary Knotts, Antonio Alfonseca, Jay Powell, Randy Veres and Bob McClure.

The back-to-back homers thwarted what would have been Henderson Alvarez's sixth win. Alvarez filled up the zone, throwing 72.2 percent of 97 pitches for strikes during his seven-inning outing. Though he settled for the no-decision, Alvarez extended his run of consecutive outings giving up two runs or fewer to eight.

Only Josh Johnson and Jose Fernandez (each with 13) have put together longer runs in franchise history. Alvarez now is tied with Dontrelle Willis for the third-longest stretch among Marlins' starters.

The Marlins have won 11 of the last 12 games, including the last nine in a row, Alvarez has started.

Facing his former team for the fourth time this season, Burnett through six innings struck out 10, one shy of his May 30 season-high against the Mets. Six of those strikeouts came during his final two innings, but Burnett nonetheless was on the verge of his second loss in as many weeks against the Marlins.

Burnett held the Marlins to a pair of singles and struck out four through three scoreless innings, but he couldn't keep them off the board in the fourth. Giancarlo Stanton drew the first of two Marlins' walks in and scored along with Casey McGehee on Jarrod Saltalamacchia's one-out, base-loaded single.

The broken-bat base hit to center made the Marlins 17-for-73 (.233) with the bases loaded. Saltalamacchia has hit safely in all but two of nine games started since coming off the disabled list. He's knocked in five in his last three games against the Phillies.

Burnett batterymate Cameron Rupp had a direct hand in the Marlins' taking the lead in the fifth. With one run in and men on first and second, Rupp and Burnett got crossed up on a sign. The resulting passed ball allowed both runners to advance.

Ozuna followed and swing through a Burnett pitch for strike three that should have ended the inning. Rupp could not keep the ball in front of him and Stanton sprinted home.

With a Christian Yelich on second and one out, the Phillies opted to pitch to Stanton. He took Burnett's first pitch out of the zone before smacking the second into right-center field. With his next run batted in, Stanton can join Mike Lowell (28/76) and Cliff Floyd (21/70) as the only Marlins ever to reach the 20-homer and 62-RBI plateaus in the first half.

Since June 21, Stanton can boast multi-hit games in seven of 10 contests. In his last five against the Phillies, he's 9-for-18 (.500) with two doubles, a homer, two RBI, five runs and six walks.

"We've had several opportunities to get that big hit," Redmond said. "It's been a little bit elusive late in the game. Tonight, Eddie got one and it was big...We had to play a few extra frames, but we got it done."

jcrodriguez@tribune.com or @JCRMarlinsbeat on Twitter.