Trailing 2-0 after three innings, the A's came back in the fourth against Tim Lincecum (2-4).
After the A's loaded the bases with one out, Kurt Suzuki drove in a run with an infield hit, cutting the deficit to one. One out later, Cowgill lined a solid hit to center field that drove in two runs, putting the A's ahead for good.
Cowgill later came around to score on Lincecum's wild pitch.
Josh Reddick smacked a two-run homer for Oakland, which salvaged one win in its three-game interleague rivalry series with the Giants.
Bartolo Colon (4-4) earned with five solid innings, allowing a pair of runs on six hits. The veteran struck out seven while issuing two walks.
Lincecum absorbed his fourth start without a win, surrendering four runs on five hits over four frames.
Melky Cabrera went 4-for-4.