NEW YORK -- With a desperate rally in the rain, Carlos Beltran and the New York Mets kept their playoff destiny in their own hands.
Beltran singled home the winning run with two outs in the ninth inning and New York beat the Chicago Cubs 7-6 on Thursday night for a huge win that halted its late-season slide.
"I was going to the plate thinking I have to come through," Beltran said. "We have three games left and it's going to be hard."
After trailing by three runs in the seventh, New York fought back to move within one game of NL East-leading Philadelphia with three to play. The Mets also stayed tied atop the wild-card standings with Milwaukee, which beat Pittsburgh 5-1 in 10 innings.
"The one thing about this team is it has responded to adversity," New York manager Jerry Manuel said. "Tonight was another example of that."
Rich Harden pitched six solid innings in his final playoff tuneup for the NL Central champions and lightly used rookie Micah Hoffpauir went 5-for-5 with five RBIs and his first two major league homers -- including a tiebreaking shot in the seventh off Ricardo Rincon that gave Chicago a 6-3 lead.
"He put on a show tonight. It was fun to watch," teammate Derrek Lee said. "I think the Brewers and the Phillies, they couldn't be disappointed in our effort."
But the Cubs, resting most of their stars, couldn't hold on.
"From top to bottom on this roster, guys want to fight and guys want to win," Reed Johnson said. "We're not going to cruise."
The Mets play Florida in the final regular-season games at Shea Stadium this weekend. Philadelphia hosts Washington, while the Cubs visit Milwaukee.
Pitching what could be his final game for the Mets, Pedro Martinez struck out a season-high nine and left to a warm ovation with the score tied 3-all in the seventh. He pointed to the crowd and raised his fist high.
"I appreciate their support, in case this is my last game, my last start," Martinez said. "I wish I could continue and come back with the Mets. But this isn't the time to think about those things. ... I couldn't go by without saying thanks."
Jose Reyes singled off Kevin Hart (2-2) to start the ninth and swiped second for his third steal of the game as David Wright fanned for the second out. Carlos Delgado was intentionally walked and Beltran lined a 2-0 pitch off the glove of a diving Hoffpauir at first base.
The ball trickled down the right-field line as Reyes scored easily, giving the Mets their second victory in six games since they grabbed the division lead with a win last Friday at Atlanta.
Beltran was mobbed by soaked teammates near first base, a sigh of relief -- for one night, at least -- as New York tries to avoid its second consecutive September collapse.
Cancel doubled leading off the seventh and scored on Reyes' grounder. Then, with two outs and none on in the eighth, New York hit four straight singles to tie it.
Ramon Martinez, making his first start for the Mets after a helpful performance off the bench Wednesday, cut it to 6-5 with a single. Cancel, added to the lineup because of Brian Schneider's aching back, lined a 1-2 pitch to right off Bob Howry.
Kosuke Fukudome's strong throw home was up the line but it arrived ahead of Ryan Church, who danced around catcher Koyie Hill on the wet dirt. With both players struggling to maintain their footing, Church slipped to the ground, then lunged and touched the plate with his hand for the tying run.
Hill threw his arms up in disbelief and the crowd responded with a thunderous roar. A pulsing Shea Stadium shook under the feet of jumping fans.
Joe Smith (6-3) escaped a jam in the top of the ninth, and the Mets rebounded from a demoralizing, 10-inning loss Wednesday night.
Wright hit a sacrifice fly in the first for his 124th RBI, matching Mike Piazza's team record set in 1999.
Church's two-run double with two outs in the fourth tied it at 3. Church was 3-for-3 with a walk and his first extra-base hit since Sept. 9.
Pedro Martinez tied Hall of Famer Bob Gibson for 13th place on the career strikeout list at 3,117. The three-time Cy Young Award winner has allowed 23 first-inning runs in 20 starts this season. ... Manuel indicated he won't use RHP John Maine this year. Maine, who has a bone spur in his right shoulder and will need surgery after the season, was activated from the disabled list Wednesday. But Manuel said he's not comfortable asking a youngster to pitch with pain in the heat of a pennant race after missing 4 1/2 weeks. ... Cubs manager Lou Piniella said it would be nice to get RHP Carlos Zambrano some work Sunday as a tuneup for the playoffs. Zambrano lasted 4 2/3 innings and 87 pitches Wednesday night against the Mets.