Cain (2-0) handled the Diamondbacks on four hits, yielding only one run and a pair of walks with three strikeouts as the Giants began a three-game series in Phoenix with a victory.
Miguel Tejada added two hits and an RBI and Brian Wilson collected his third save despite allowing a run-scoring single to Willie Bloomquist in the ninth.
Diamondbacks starter Daniel Hudson (0-3) was tagged for five runs (four earned) on six hits over six innings.
Former Titans kicker dies in car crash
UPI Sports Results for September 20, 2014