The Giants earned their fifth walkoff victory.
Hunter Pence homered against his former club for the second time during the three-game series, but Romo was not his usual spot-on self in the ninth.
Pence sent a 2-2 pitch into the stands in left field leading off the second for his seventh homer. Marco Scutaro hit a go-ahead single in the fifth to score Gregor Blanco after he singled and stole second.
PADRES 1, MARLINS 0
In San Diego, California, Jason Marquis outpitched Ricky Nolasco, while Yonder Alonso had a sacrifice fly in the sixth inning as San Diego completed a three-game sweep of Miami.
Marquis (4-2) allowed five hits, walked one and struck out three in eight innings, his longest stint since last Aug. 11 last year, when he had a 5-0 shutout at Pittsburgh.
Huston Street pitched the ninth to pick up his eighth save in eight chances.
The Padres have won four straight and 11 of their past 14.
Nolasco (2-4) gave up one run and four hits, with one walk and a season-high nine strikeouts in seven innings. He had won his four previous decisions at San Diego, where he dropped to 4-2 with a 2.11 ERA in his career.
CARDINALS 5, CUBS 4
In Chicago, Carlos Beltran and Jon Jay drove in two runs apiece as St Louis won for the seventh time in eight games to improve to a major league-best 14-7 on the road.
Beltran also had three hits as St Louis went 5-1 on a six-game swing to Milwaukee and Chicago, with the lone loss coming on Tuesday in their first game of the season against the last-place Cubs.
In other NL action, it was:
‧ Braves 7, Reds 2
‧ Diamondbacks 3, Dodgers 2
In interleague play, it was:
‧ Yankees 3, Rockies 2
‧ Rangers 4, Brewers 1
‧ Nationals 3 Tigers 1
‧ White Sox 6, Mets 3
‧ Mariners 2, Pirates 1