PHILADELPHIA (AP) -- With each clutch hit, Fernando Tatis shows he's more than just another castoff hanging onto his major league career.
Tatis hit a two-run homer in the 12th inning, lifting the Mets to a 4-2 victory over the Philadelphia Phillies on Sunday in a game that ended more than seven hours after it started.
Jayson Werth hit a two-run shot off Mets closer Billy Wagner with two outs in the ninth to send the game into extra innings after it was delayed 2 hours, 50 minutes because of heavy rain in the bottom of the eighth.
But the Mets avoided another devastating loss in a season filled with them when Tatis connected off Chad Durbin (2-2) with one out in the 12th for his second homer of the season.
Tatis, who hit 34 homers in 1999 for St. Louis, spent two years out of baseball in 2004-05 and had a hard time finding a job. But he's had a knack for getting key hits since joining the Mets. Tatis delivered a pair of game-winning hits in the same week in late May.
"It's a great feeling," he said. "We've just got to continue to play the way the we're playing right now. It's a great feeling for me to come into a situation like this and winning the game. It's amazing."
Joe Smith (1-1) pitched 2 1/3 scoreless innings to earn the win.
The Mets have won two in a row in a big series against the NL East-leading Phillies. They trail Philadelphia by 3 1/2 games with a chance to move closer in the finale Monday night.
New York was one strike away from winning when Werth drove a 1-2 pitch from Wagner into the left-center field seats to tie it at 2. Wagner, named to the All-Star team for the sixth time in his career earlier in the day, has six blown saves in 25 chances.
"I've blown enough of them and been an All-Star," Wagner said. "The biggest part to me is we came back, the guys picked me up and we won. That's going to happen. I'd like to bounce that slider, but I hung it, Jayson hit it, but we came back and won."
Wagner was sitting in the clubhouse watching Tatis' at-bat on television when outfielder Ryan Church came up to him and predicted the shot.
"He said, 'Don't worry about it. Tatis is going to hit one out here anyway,'" Wagner said.
Mets starter Oliver Perez allowed four hits, struck out six and walked two in seven innings.
Trailing 1-0, the Phillies had two runners on with one out and Ryan Howard at the plate against Pedro Feliciano when rain came. By the time it resumed, only a fraction of the sellout crowd remained and most of the Mets fans were gone.
After the long delay, Feliciano fanned Howard on three pitches. Aaron Heilman replaced Feliciano and walked Pat Burrell to load the bases. But he retired Pedro Feliz on a bouncer to the mound to end the inning.
Phillies starter Kyle Kendrick allowed one run and eight hits in six innings.
"Kendrick kept us in the game," Phillies manager Charlie Manuel said. "He did a good job like he always does."
Carlos Beltran lined a 3-2 pitch off Kendrick into the right-field seats in the third to give the Mets a 1-0 lead. Beltran was in a 2-for-21 slump before he connected for his 13th homer.
Beltran's two-out RBI single off Brad Lidge in the ninth gave the Mets a 2-0 lead that Wagner couldn't protect.
Both starters threw a lot of pitches and worked out of trouble much of the game. The Phillies had runners on second and third with one out in the first, but Howard struck out and Burrell fouled out.
Mets right fielder Endy Chavez made a sensational, leaping catch sprinting toward the right-field corner to rob Carlos Ruiz of extra bases and save a run in the second. An appreciative Perez walked off the mound, pointed to Chavez and tipped his cap.
The Phillies placed RHP Tom Gordon on the disabled list with right elbow inflammation. LHP R.J. Swindle was recalled from Triple-A Lehigh Valley to take his spot. ... Phillies SS Jimmy Rollins stole his 35th straight base without getting caught, dating to last Aug. 31. He's 21-for-21 this season. ... Wagner was the only Mets player picked for the All-Star team. 3B David Wright is among the five players up for the final spot to be chosen by fans through online voting. He'll compete with Burrell and three other outfielders. Lidge and 2B Chase Utley already were selected to represent the Phillies.