Chris Heston (5-3) allowed four hits over 7 1-3 innings to win his third straight decision and give the Giants 12 wins in their past 14 games. He also doubled, his first career extra base hit.
Hunter Pence added a two-run triple and Joe Panik a two-run double in a six-run eighth inning against Brandon Cunniff to break the game open. Brandon Crawford had two hits and drove in a run and Nori Aoki added two hits.
Pence became the first right-handed hitter to hit safely against Cunniff, ending his streak of 30 straight to begin his career.
Shelby Miller (5-2), who came within one out of a no-hitter in his last road start, took the loss despite allowing one run and five hits over seven innings.