The Mets long have been out of playoff contention in a season in which they hoped to make major progress. But their dramatic "come-from-ahead" 6-5 win over Philadelphia Sunday afternoon at Citi Field showed they are anything but down about their predicament.

Although they did their best to squander the 5-2 cushion backup catcher Anthony Recker gave them with a three-run homer off Phillies starter A.J. Burnett (7-15) in the bottom of the sixth inning, the Mets showed real toughness in key spots and got a lift from rookies Wilmer Flores at shortstop and Dilson Herrera at second that offers hope for the future.

"We're very young as you can see," manager Terry Collins said of a lineup that included three rookies and two second-year players. "We haven't played anywhere near like we thought we were going to, but they come to the clubhouse each day with a smile on their face and get ready to play. You've got to make sure you stay positive, and this team does that."

Collins credited veterans David Wright and Curtis Granderson for setting a positive tone, but he sat Granderson after a 1-for-17 slump on the homestand to allow him to "clear his mind." Wright was 1-for-10 during the homestand coming into the game but had two hits, including a single that gave the Mets a 2-1 lead in the fifth.

That was when the dramatics began. Mets starter Dillon Gee (6-6) surrendered the tying home run in the sixth to Phillies slugger Ryan Howard, his 20th. But Gee's toughness in three key spots kept the game in check.

Gee allowed a fourth-inning run but got out of a bases-loaded situation when Wil Nieves hit into an inning-ending double play turned by Flores and Herrera. With a man on third and two outs in the fifth, Gee struck out Jimmy Rollins, and he stranded two more Phillies in the sixth after Howard's homer.

"I was trying to bear down and make good pitches when I had to," Gee said of the double-play ball. "I got fortunate there. I thought the big one was the strikeout to Rollins to end the inning."

The Mets took tenuous control in the bottom of the sixth when Flores led off with his third single of the day, and Herrera drew a one-out walk. Phillies manager Ryne Sandberg visited Burnett but left him in to pitch to Recker, who had struck out twice. Big mistake. Recker jumped on the first-pitch curve and buried it in the leftfield seats for a 5-2 lead.

"He had thrown me a first-pitch curve on a couple of at-bats," Recker said. "I knew they told him to attack me because we had Curtis Granderson on deck as a pinch-hitter. He had to get ahead or throw a strike. I didn't know for sure he'd throw the curve. I got lucky."

The Phillies got a run-scoring single from Rollins in the seventh before reliever Dana Eveland stranded two runners with strikeouts of Howard and Grady Sizemore. Domonic Brown homered off Mets reliever Jeurys Familia leading off the eighth to make it a one-run game, but a diving stab by Flores of a grounder up the middle got the Mets out of the inning.

In the Mets' eighth, Kirk Nieuwenhuis, playing for Granderson, doubled, stole third and scored when Herrera singled for his first major league RBI. It turned out to be the winning run.

Mets closer Jenrry Mejia allowed the first two batters to reach base in the ninth before Herrera and Flores turned another double play on a grounder by Howard against the shift. Mejia gave up an RBI single by Sizemore before closing it out.

Reflecting on all the plays that allowed the Mets to pull out an otherwise meaningless game, Eveland said, "Hopefully, it can lead to us playing a strong September.

"Our pitching is going to be stronger in the future. There's talent in this clubhouse. We want to finish strong with the idea that this is going to be a playoff team."