By JANIE McCAULEY, AP Baseball Writer

SAN FRANCISCO (AP) — Yasmani Tomas hit a go-ahead home run in the fourth, Paul Goldschmidt drove in two runs, and the Arizona Diamondbacks beat the San Francisco Giants 6-2 on Thursday for a four-game sweep.

Tyler Wagner (1-0) allowed two hits in five relief innings of Shelby Miller as Arizona wrapped up a 7-3 road trip with a fifth straight win and first four-game sweep ever in the Giants’ 17th-year ballpark and fifth of three or more games.

READ MORE: Deals or Disappointment? A Mixed Bag for Local Shoppers This Black Friday

The benches cleared and both teams were warned in the eighth after Josh Osich hit Arizona’s David Peralta with a pitch for the second straight day. Peralta walked toward the mound, but there were no ejections.

READ MORE: Could The Perfect Hug Improve Your Health?

Johnny Cueto (3-1) was tagged for his first loss since joining the Giants on a $130 million, six-year contract.

MORE NEWS: Father's U-Haul Stolen In Sacramento While Moving From Oregon To Arizona

Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.