Pablo Sandoval hit a go-ahead two-run single in the sixth to help Barry Zito end a six-start winless stretch, and the San Francisco Giants beat the Oakland Athletics 5-2 on Thursday to avoid a season sweep.