Pujols hit his 20th home run of the season and 12th this month on a 1-1 pitch from reliever
Los Angeles trailed 7-2 before breaking out against Gray and three relievers in the seventh.
Gray walked the first two batters in the inning then gave up an RBI-single to
Pujols followed with his 12th home run in the last 21 games. He had an RBI-double in the ninth.
Giovatella, who had an RBI double in the second and a sacrifice fly in the fourth, added an RBI single to make it 10-7.
The A's committed three of their four errors in the inning, raising their total this season to 69, the most in the majors.
Gray, who took a majors-low 1.60 ERA into the game, was in line for his ninth win until the Angels' outburst. He allowed six runs and five hits in six-plus innings while matching his career-low with two strikeouts. The Oakland ace also dodged a potential serious injury in the fourth when he speared Joyce's two-out line drive just as the ball neared his head.