Zito, off to the best start in his career, improved to 5-0 in six starts. He took a 3-0 lead into the eighth inning before requiring rescue from the bullpen.
Romo, who gave up a three-run homer in the Giants' 12-inning win Tuesday, rebounded by needing only six pitches to escape a bases-loaded, none-out situation in the eighth.
When Romo reached the jubilant dugout, Zito was among those offering congratulations.
"He was happy for me, especially with what happened Tuesday night," Romo said, his voice cracking with emotion. "It's pretty hard to bounce back. It was his way of showing me, 'You're a guy we do count on."'
Wilson gave up a run in the ninth but left runners stranded at the corners for his fifth save in six chances. The narrow escape was a welcome change for the Giants, who improved to 2-5 in one-run games.
"We couldn't have been in tougher jams," manager Bruce Bochy said. "We've lost some gut-wrenching games. You hope they even out, and now we got a couple back here."
Aaron Rowand hit his third home run of the season and his second in two nights for the Giants, who won despite going 1 for 11 with runners in scoring position.
Nate Robertson (2-3) lost his third decision in a row. He allowed three runs, two earned, in 5 1/3 innings.
That was no match for Zito, who allowed seven hits and one run to lower his ERA to 1.49. He limited the Marlins to three hits before giving up four consecutive scratch singles -- including two infield hits -- to start the eighth.
"Romo was unbelievable," Zito said. "Not only did he do something incredible in getting out of a bases-loaded, no-outs jam against their two best hitters, but coming off last night, a lot of guys would have been defeated out there. Romo has as much courage and tenacity as any guy I've played with."
The Marlins mounted another threat in the ninth. Dan Uggla and Ronny Paulino singled to start the inning, and with one out Brett Carroll was hit by a pitch. Chris Coghlan bounced into an RBI forceout at second, and Wes Helms struck out to end the game.
"We had opportunities in the eighth and ninth with the right guys up to the plate, and it didn't happen," manager Fredi Gonzalez said.
Before Zito tired, his off-speed pitches had the Marlins often hitting the ball weakly early in the count. Among those stymied was 2009 NL batting champion Ramirez, who went hitless and is 1 for 13 lifetime against the left-hander.
Zito struck out four, walked one and improved to 4-0 with a 1.07 ERA in four career starts in Miami. He ranks among the NL leaders this season in victories and ERA.
"I'm not too high, I'm not too low," he said. "I'm just going out there playing as hard as I can and hoping the baseball gods are good to me."
The Giants took the lead in the third when Matt Downs led off with a double, advanced on Zito's sacrifice and scored on a groundout by Rowand.
Rowand, who homered with two outs in the ninth to tie Tuesday's game, led off the sixth with a home run.
The Marlins, last in the majors in fielding, worked on defensive drills during batting practice, but the workout failed to help left fielder Carroll. He dropped a fly for a two-base error in the sixth.
"I expect to catch that ball," Carroll said. "I just missed it."
Bengie Molina followed with an RBI single to make it 3-0. He's batting .423 against left-handers.
- Marlins LF Coghlan, batting .180, was held out of the starting lineup against the left-handed starter. Sanchez moved up to second in the lineup, and Gonzalez hinted he may stay there for a while.
- Giants SS Edgar Renteria (groin), sidelined since leaving Friday's game, is expected back in the starting lineup Thursday.
- Marlins 3B coach Joe Espada was absent because of a death in the family.