Updated

Matt Harvey was marvelous in the final start of his rookie season. The only thing missing was a win.

Ryan Howard hit a go-ahead homer off Josh Edgin with two outs in the ninth inning and the Philadelphia Phillies rallied to beat the New York Mets 3-2 on Wednesday night, adding a dramatic victory to their late-season playoff push.

In his latest eye-catching performance, Harvey struck out seven over seven stellar innings and did not allow a hit after Jimmy Rollins' leadoff home run. This was his last outing of the year, though. The prized right-hander, drafted seventh overall in 2010, will be shut down after 10 major league starts to protect his 24-year-old arm.

"I wish we would have got a win for him," Mets manager Terry Collins said. "But Matt Harvey ought to spend the winter feeling pretty good about himself and the way he's handled everything up here, the way he's pitched."

Philadelphia went into the ninth with only two hits. Chase Utley worked a two-out walk on a full-count pitch from Edgin (1-2), filling in for ailing closer Frank Francisco, and Howard launched a 93 mph fastball off the facing of the second deck in right field to give his team a 3-2 lead.

Edgin, another promising rookie, had not allowed an earned run since Aug. 19, putting together 16 straight scoreless appearances.

"Big guy. He's paid to hit home runs. So I give him a meatball, that's what he's going to do," Edgin said.

Howard pumped his fist as he rounded first base and Phillies players broke into a happy frenzy on the bench. It was Howard's 11th homer in an injury-shortened season and first since Aug. 31.

"He was kind of due," manager Charlie Manuel said. "He needed a big hit like that, and he came through. ... I'm sure that will give him a big boost."

Trying for a last-gasp run at the postseason after a miserable first half, the surging Phillies (75-74) won for the 10th time in 13 games. They remained four games behind St. Louis for the second NL wild-card spot, with two other teams in between.

"To be here is a testament to the character of this team — that we don't give up," Howard said. "It's a 162-game season and we're just going out here trying to play it all out."

Cole Hamels equaled a season high with 10 strikeouts over six innings and left trailing 2-1. Philadelphia's young bullpen kept it close, and Jeremy Horst (2-0) got Andres Torres to ground into an inning-ending double play with the bases loaded in the eighth.

Jonathan Papelbon worked a one-hit ninth for his 36th save in 40 tries. Left fielder Domonic Brown, who had just shifted over from right, helped out with a diving catch in the corner.

The punchless Mets wasted a splendid effort from Harvey, who finished with a flourish. David Wright hit a solo homer but New York (66-82) dropped its eighth straight home game and 24th in the last 28 at Citi Field.

This one guaranteed a fourth consecutive losing season, despite a 46-40 first half.

New York has lost four in a row and 10 of 11 overall. The Mets have managed three runs or fewer in a team-record 15 straight home games since a 6-5 win over Atlanta on Aug. 12 at Citi Field.

A bright spot in a dismal second half, Harvey walked three and threw a career-high 112 pitches. He has tossed 169 1-3 innings this season between the Mets and Triple-A Buffalo.

Harvey finished 3-5 with a 2.73 ERA and 70 strikeouts in 59 1-3 big league innings, permitting only 42 hits and 26 walks.

He got two double plays Wednesday night and whiffed Howard for the second time with a 97 mph fastball in the seventh. Harvey walked off to a standing ovation from the sparse crowd of 21,741 and received a handshake from veteran catcher Kelly Shoppach.

"There was definitely some excitement. I had some tingles. It was kind of a sad moment, I guess, because I knew I was done," Harvey said. "It was a good experience. ... I left it all out there."

Bobby Parnell struck out two in a one-hit eighth and handed the lead to Edgin, seeking his first career save. Francisco was unavailable after an MRI showed tendinitis in his pitching elbow.

One night after the teams were rained out at Citi Field, Rollins gave the Phillies another quick start when he homered to right on Harvey's fifth pitch. It was his 43rd career leadoff shot and sixth this season.

Ruben Tejada singled and stole second with two outs in the third before scoring on Daniel Murphy's tying single.

Wright opened the sixth with an opposite-field drive to right-center for his 201st career homer and 18th this year. After a sensational start to the season, he has only two home runs and 12 RBIs since July 28.

NOTES: Francisco is day to day. ... The Mets are hitting .198 with runners in scoring position since the All-Star break. ... The previous major league club to score three runs or fewer in more consecutive home games was Seattle, which went 16 straight in 2010. ... New York fell to 59-2 when leading after eight innings. ... Rollins has 26 homers against the Mets, his most against any team. ... RHP Tyler Cloyd (1-1), who lost to Harvey in his major league debut on Aug. 29, is scheduled to start Thursday night's makeup game for Philadelphia. Fellow rookie Jeremy Hefner (2-6) pitches for the Mets.