MIAMI — Randall Delgado got his first major league win in a game desperately needed by the Braves.

The cool, calm rookie pitched five innings of five-hit ball in a 4-0 win against the Florida Marlins on Tuesday night at Sun Life Stadium, allowing the Braves to reduce their magic number in the too-tight-for-comfort National League wild-card race.

“It feels so good," said Delgado (1-1), who lowered his ERA to 2.70 in six starts. "I’m happy. It was an important victory for the team, too. I was thinking of that before the game, focusing on how we needed to win.”

Cristhian Martinez and Anthony Varvaro pitched two perfect innings apiece to complete the five-hit shutout.

The Braves ended a two-game skid and dropped their magic number to clinch the wild card to six against St. Louis and four against San Francisco, after the Cardinals beat the New York Mets and the Giants lost to the Los Angeles Dodgers.

"We need to win," said Fredi Gonzalez, whose Braves saw their wild-card lead shrink to 2-1/2 games over St. Louis entering Tuesday. "If we take care of business in front of us, we don’t have to worry about what’s behind us.”

There are seven games left in the regular season for Atlanta, including three this weekend at Washington and three at home against Philadelphia starting Monday. Any combination of six Braves wins and Cardinals losses clinches the wild card for Atlanta.

Alex Gonzalez homered off Anibal Sanchez (8-9) to lead off the three-run second inning, but the hot-hitting shortstop left in the sixth inning with a strained right calf and was listed as day-to-day.

He hopes to return Friday, after the team's day off Thursday. The Braves  can’t afford to lose Gonzalez, who is 14-for-30 (.467) with four doubles, three homers and seven RBIs in eight games since missing a series at St. Louis to rest his strained back.

Gonzalez originally felt the calf tighten  Saturday while standing at his position, andthought it was a cramp. He felt a twinge again during Tuesday's game.

"We don’t think it’s major, but those calf injuries can become major," Fredi Gonzalez said. "So we got him out of there. Hopefully it's just a couple of days."

Rookie Freddie Freeman also hit his 20th home run for the Braves, who improved to 7-1 this season at Sun Life Stadium, mostly empty despite an announced attendance of 21,733 (there were perhaps one-fourth that number present and accounted for).

“It’s huge," third baseman Chipper Jones said of the win, which came on the heels of a wrenching 6-5 loss Monday when the Braves blew a ninth-inning lead. "I’m proud of the guys for the way they bounced back tonight. I still would have liked to have seen us score seven or eight and make it a laugher, but we’ll take it any way we can get it.

"I thought we swung the bats pretty good. We got Anibal’s pitch count up early in the game, and the kid [Delgado] made pitches when he had to.”

The Braves’ last game at the stadium is Wednesday. The Marlins move to new retractable-roof ballpark near downtown Miami in 2012, and will change their name to the Miami Marlins.

It’s a charmless place for baseball, but Delgado (1-1) will likely have fond memories of the orange-seated behemoth of a stadium where he got his first big-league win. He admitted feeling some additional pressure given the Braves' playoff picture.

“I had to put my mind so I could do a good job today and concentrate no matter what happened," he said. "There was a little pressure, but after a couple of innings I forgot that and tried to win, no matter what happened.”

The slender Panamanian has impressed with composure and mound presence unusual for a pitcher so young (21) and inexperienced. Delgado allowed five hits and two walks with one strikeout in five innings, throwing 55 strikes in 92 pitches and lowering his ERA to 2.70 in six starts.

“He expects to go do that stuff, which is what you wish everybody had," Braves catcher Brian McCann said. "It’s one thing to have the ability as a rookie, and to have the ability to come up and expect to be good – I think you’re born with that.”

“He’s getting better, he’s learning more. He came out tonight in a big game and stepped up huge for us. And I can’t say enough about Cristhian Martinez and Varvaro, thowing multiple innings, throwing up zeroes and not even letting anybody on base."

The Marlins loaded the bases with one out in the third inning on two singles and a walk. Delgado coaxed Logan Morrison to hit a soft liner to Gonzalez for an inning-ending double play. Delgado faced Mike Stanton with two on and two out in the fifth, and induced a routine grounder to Gonzalez.

“He showed a lot of poise out there, a lot of focus," Jones said. "He’s given us a chance to win pretty much every time he’s taken the hill. That’s all you can ask out of him. I don’t think he’s given up more than two or three in a start yet. For a kid that was in Double-A at the beginning of the season, he’s showing that he belongs here.”

Since returning to the majors two months after a June 17 spot-start debut, Delgado has posted a 2.07 ERA and .185 opponents’ average in five starts, allowing just 17 hits and six runs in 26 innings. He has allowed one or no runs in four of those five starts.

The Braves scored three runs in the second inning, after totaling four runs while Delgado was in the game during his previous five starts.

Gonzalez homered on the first pitch of the second inning, the 15th home run for Miami resident and former Marlins shortstop.

Jason Heyward followed with a double and scored one out later on a Michael Bourn double for a 2-0 lead. Martin Prado followed by bouncing a single up the middle to score Bourn.

After allowing only two earned runs in 21 innings of three previous September starts, Sanchez gave up three runs and five hits in five innings against the Braves. He’s 4-10 in 16 career starts against Atlanta, including 0-5 with a 6.23 ERA in his past six.