NEW YORK -- Alex Rodriguez slammed his bat and then threw it. The first Subway Series game at new Yankee Stadium was over.

And then it wasn't.

Second baseman Luis Castillo dropped A-Rod's two-out popup in the ninth inning as Derek Jeter scored from second and Mark Teixeira from first, giving the Yankees a wild 9-8 victory over the Mets on Friday night.

"As soon as I slid in, I hugged Jete and I said, `What just happened?' because I couldn't believe it," Teixeira said.

David Wright had put the Mets ahead 8-7 with an eighth-inning double off Mariano Rivera (1-2), and Francisco Rodriguez (1-1) appeared to escape a ninth-inning jam on the popup by A-Rod, just 1 for 17 in his career off K-Rod, including the postseason.

But Castillo kept drifting toward the foul line and allowed the ball to pop out of his glove as he tried for a one-handed catch on the right field grass. The Yankees ran onto the field to celebrate.

A few minutes later, Castillo sat alone in the visitor's clubhouse, leaning forward, his elbows on his knees, his head resting on his hands. His eyes were reddening.

A three-time Gold Glove winner, Castillo called it a "routine fly ball."

"I feel bad. I feel so bad," he said following his fifth error of the season. "The ball was moving a little bit."

It was yet another stunning defeat for the Mets, who keep finding new ways to lose. They lost to Florida on April 12 when left fielder Daniel Murphy dropped Cody Ross' fly ball. And on May 18 they lost to the Los Angeles Dodgers after Ryan Church missed third base en route to not scoring the go-ahead run in the 11th inning.

"We'll have to fight through this," Mets manager Jerry Manuel said. "This is definitely a tremendous test for us."

Both teams came in staggering. The Yankees had been swept in a three-game series at Boston's Fenway Park and the Mets lost to Philadelphia in extra innings on consecutive days.

"Of course, we feel like we just stole one," Jeter said. "We were lucky. That's just the bottom line."

Jeter had singled with one out and stole second as pinch-hitter Johnny Damon struck out on the ninth pitch. Teixeira was intentionally walked and Alex Rodriguez got ahead 3-0 before taking a strike and then popping up.

Teixeira focused on third base coach Rob Thomson and ran hard from first the entire way. He easily beat shortstop Alex Cora's relay from Castillo.

"When he started waving me, I, you know, put it into second gear," Teixeira said. "I don't have a third, fourth and fifth."

It was the first blown save by K-Rod in 17 chances this season.

"I still don't believe it," A-Rod said. "I couldn't believe what I saw. I've never seen that before."

On a night the Mets brought some real energy to Yankee Stadium, known thus far for home runs and empty premium seats, the crowd of 47,967 was the largest since opening day but again short of a sellout. Fans saw five more home runs at the Bronx bandbox, raising the total to a major league-leading 110 in 30 games.

Gary Sheffield homered for the Mets, and Robinson Cano, Teixeira, Jeter and Hideki Matsui connected for the Yankees, who wasted leads of 1-0, 3-2 and 7-6 before winning. Matsui turned 35 and homered on his birthday for the second straight year -- last year he hit a grand slam off Oakland's Joe Blanton.

Rivera made a rare eighth-inning appearance in a tie game when he relieved with two outs and the score 7-7.

Carlos Beltran reached on just the third walk off Rivera in 26 2/3 innings this year. With the count 2-2, Beltran took off for second and Wright turned on a pitch over the middle of the plate. The ball hit the wall in right-center on a hop, and Beltran scored without a throw as Rivera hung his head and grimaced. Wright is hitting .633 (19 for 30) in his last eight games, raising his major league-leading average to .364.

But Castillo's error undid that. Mets fans were on him for much of last year, and are likely to direct their wrath at him anew.

"It will definitely be a battle again," Manuel said. "Not only for him, but for us as well."

Notes

Sheffield's homer went just inside the left-field foul pole and raised his career total to 505, moving past Eddie Murray into sole possession of 24th place. ... Teixeira has nine homers in his last 15 home games and 13 in his last 25 overall. ... Yankees RHP Brian Bruney (elbow) is to make a rehab appearance Saturday for Double-A Trenton. ... The Yankees had not won on a game-ending error since July 7, 2003, when Matsui scored as Boston 2B Todd Walker booted Curtis Pride's grounder, according to the Elias Sports Bureau.