NEW YORK -- During the Mets' recent three-game skid, they've put up 17 runs, but have been paralyzed by an inability to get "The Big Hit" in crucial situations.

Who better then to produce that hit on Friday night than the oft-maligned Luis Castillo?

Castillo's two-out, walk-off ninth-inning single broke the Mets' trance and capped an historic 5-4 win over the Brewers in front of 36,436 at Citi Field.

"I thought he really had shown lot of energy and a lot of fight," Mets manager Jerry Manuel said. "I kind of had a feeling that he wanted to be in that situation tonight."

Castillo's hit scored Carlos Delgado, who opened the inning with a double and advanced to third after catcher Omir Santos grounded into the inning's second out.

The Mets had loaded the bases twice in the previous two innings, but had been unsuccessful in plating the go-ahead run.

Enter No. 8 batter Castillo, who was 1-for-4 on the night -- and often a source of Mets fans' collective frustration.

"I don't want to think about last year's [problems at the plate]," Castillo said. "You know, when I see that situation, that's what I want."

Arguably the only situation more important than Castillo's RBI was the run scored before it.

With the Mets down, 4-3, in the bottom of the seventh, Gary Sheffield blasted the ninth pitch from Brewers reliever Mitch Stetter over the left-field fence to record his 500th career home run and tie the game.

The fated ball was the ninth pitch of Sheffield's pinch-hit at-bat and traveled an estimated 385 feet into the stands at Citi Field.

The timing of homer "makes it that much more special," Sheffield said. "When [the count] got 3-2, I was just thinking of getting on base and trying to win this game."

The knock marked Sheffield's first hit as a Met. The veteran was released on March 31 by the Tigers and said he never felt the pressure this offseason of being stuck at No. 499.

"I knew there was a reason behind it," Sheffield said. "There was a bigger reason and a higher purpose."

Friday night, it was a purpose that served the Mets' greater good.

"We needed [this win] in a big way," Manuel said. "Obviously you don't have too many times where there are must-wins. But when you get one team that is playing very well, you don't want to get caught too far behind them.

"When one team kind of runs out, like the Marlins did, it's important to stay within shouting distance, and in that sense, it was a big game for us."

What might be even more important for the Mets was that it was a complete game.

The Mets opened with three straight singles to load the bases for the red-hot Delgado, who hit a sacrifice fly to score Jose Reyes. Brewers starter David Bush issued a two-out intentional walk to Ryan Church and followed with another bases-loaded free pass to Ramon Castro for an easy RBI. Castillo singled in another run.

Backed by the Mets' defensive prowess, starter Livan Hernandez cruised through the first four innings before a pair of one-out singles and a sacrifice fly gave the Brewers their first score. Things got sticky for Hernandez in the sixth, and he exited after allowing a three-run homer to Ryan Braun.

"Every time I go to the mound, I want to keep the game close," Hernandez said. "I try to do my job."

And that's exactly what the Mets needed out of their fifth starter.

"As a guy who's been at the back end of the rotation for us," Manuel said, "he's given us a chance to win each of his games."

Four goose eggs from the combined bullpen efforts of Pedro Feliciano, Sean Green, Bobby Parnell and J.J. Putz gave the Mets' bats a chance to work their magic.

"We like that formula when we can get to it," Manuel said of Parnell and Putz in the game's later innings. "We just haven't been able to get to it that often."

All week, the Mets have been victims of their own sword, but if Castillo's hit is any indication, Manuel believes his offense can start to tick at the right time.

"We have somewhat struggled with men in scoring position -- especially with two outs," Manuel said. "And for him to come through in that fashion is not only big for him, its big for the team."