Eleven NL pitchers combined for a six-hit shutout as the NL scored a third straight win in the series after going 13 straight years without a win.
Giants center fielder Melky Cabrera, who was 2-for-3 with a two-run homer and two runs scored, was named the game's Most Valuable Player.
American League starter Justin Verlander of the Detroit Tigers allowed the NL's game-opening assault and suffered the loss. He gave up five runs on four hits and two walks. NL starter Matt Cain, who allowed one hit with a strikeout over two innings, was credited with the win.
Verlander struck out designated hitter Carlos Gonzalez of Colorado to open the game.
But Cabrera followed with a single to left and quickly gave the NL the only run it needed on a double by Milwaukee left fielder Ryan Braun. After Verlander struck out Cincinnati first baseman Joey Votto for the second out in the inning, he issued back-to-back walks to St. Louis right fielder Carlos Beltran and Giants catcher Buster Posey to load the bases for Sandoval.
The Giants' third baseman cleared the bases with his triple to right, then scored the inning's fifth run on an infield single by Atlanta second baseman Dan Uggla.
Not that it needed more runs, the NL added three in the top of the fourth with a two-out rally against Matt Harrison of the Texas Rangers.
Cardinals shortstop Rafael Furcal tripled with two out and scored on a single by pinch-hitter Matt Holliday of the Cards. Cabrera followed with his home run.
Cabrera and Braun were the only players with two hits in the game. Cain was the only pitcher who worked more than one inning. Closer Huston Street was the Padres' lone representative and did not get into the game.
Tony La Russa came out of retirement to manage the NL team in the third All-Star Game played in Kansas City.
Prince Fielder of Detroit won the Home Run Derby for the second time.