The Athletics scored six times in the second inning, but Arizona battled back to within two heading into the ninth and then shocked the A's with a two-out comeback.
Oakland lost for the 12th time in 16 games while the Diamondbacks won their third in a row.
Brandon Inge had two hits in the second inning and drove in the last of Oakland's six runs in that frame, during which the A's sent 11 men to the plate.
Oakland went on to pile up 16 hits, one more than Arizona, and seemed ready to claim the victory when Brian Fuentes retired the first two men he faced in the ninth.
Jason Kubel had a two-run homer in the second and added an RBI double in the sixth as part of Arizona's comeback.
Fuentes (2-2) blew his third save in eight chances.
The win went to J.J. Putz (1-3), who struck out two in the top of the ninth.