The victory moved the Yankees back into sole possession of first place. Tampa Bay, which lost to Toronto, and New York had spent eight days tied atop the AL East.
The Yankees, who came back from a three-run deficit to win 11-5 the night before, jumped on A's starter Vin Mazzaro right away. Brett Gardner led off the first with a single, and the Yankees scored three runs in the inning, helped by second baseman Mark Ellis's fielding error and Jorge Posada's triple.
They added two more in the third when Nick Swisher homered one batter after Mark Teixeira singled with one out. Curtis Granderson hit a one-out solo shot in the fourth before Teixeira hit his 30th homer of the season.
Yankees starter Phil Hughes (16-6) walked five but only gave up two runs and four hits in five innings.
Chad Gaudin pitched three effective innings in relief, giving up only Daric Barton's solo shot, and David Robertson finished the six-hitter for New York, which went 16-13 in August.
Lost in all the slugging was the end of Marcus Thames' home run streak. After six homers in five straight starts, Thames went 0 for 4. It wasn't pretty, either: He struck out three times and fouled out to the catcher his fourth time up.
Mazzaro (6-7) left after allowing nine runs, seven of which were earned, in 3 2-3 innings. He lost his fifth straight decision and hasn't gotten a win in seven starts since July 24 against the White Sox.
The A's are 4-19 against the Yankees over the past three years — including 1-7 this season.
Oakland had an ugly first few innings. In addition to Ellis' first-inning error, he hit a ball about two feet up the line and then ran right into it for the second out of the third with a man on. Left fielder Jeff Larish badly misplayed the ball on Posada's triple. His drive caromed off the wall back behind Larish, and the 39-year-old catcher was able to chug in to third ahead of the throw. It was the 10th triple of his career.
Notes: Yankees LHP Andy Pettitte said he plans to throw in the bullpen on Wednesday as he recovers from a groin strain. He said he hopes to throw at full effort and simulate being in a game by sitting and resting during the session. ... Derek Jeter went 0 for 3 with a walk, and has two hits in his last 30 at-bats. ... Before the bottom of the seventh started, the A's made a double switch — rarely seen in the AL — sending in replacements at catcher and shortstop, swapping their places in the batting order. The move is almost always done to keep pitchers from having to bat in the next inning.