Alex Rodriguez had hit No. 3,020 to move into the top 25 on baseball's all-time list.
Rob Refsnyder had the first two of his career, the second a two-run homer that turned out to be the difference in the New York Yankees' 8-6 victory over the Boston Red Sox on Sunday.
"We brought him up here to play. He gets a big two-run homer," Yankees manager Joe Girardi said after his team headed into the All-Star break with a 3 1/2-game lead over second-place Tampa Bay.
Boston had hoped to cut further into a deficit that had been 10 games three weeks ago, but the Yankees won two out of three over the weekend to leave the last-place Red Sox 6 1/2 back.
Rodriguez, who homered in the first two games, delivered a sixth-inning double to give the Yankees a 4-3 lead. That tied him with Rafael Palmeiro at 25th on baseball's career list; Rodriguez needs three hits to tie Lou Brock at No. 24.
Refsnyder had his first career hit with a single in the seventh inning, then added a two-run homer in the ninth to make it 8-4. The Red Sox cut it to 8-6 in the ninth thanks to two New York errors, but Andrew Miller got Shane Victorino on a pop-up to shallow left to end it.
Refsnyder got the home run ball back and will give it and the lineup card to his parents.
"All that rookie stuff," he said.
Brian McCann also had two hits, including a two-run homer. Nathan Eovaldi (9-2) gave up three runs on seven hits, striking out four in five innings to win his fourth straight decision.
Xander Bogaerts, Hanley Ramirez and Alejandro De Aza each had two hits for Boston. The Red Sox had won 10 of 13.
Wade Miley (8-8) gave up the tying run on a fifth-inning balk and ran into more trouble in the sixth.
Gardner led off with a slow chopper to second base for an infield single, then Rodriguez lined his milestone double to center.
One out later, Chris Young doubled to left to score Rodriguez and chase Miley.
Tommy Layne got McCann on a grounder, but Headley doubled to score Young and make it 6-3.
Boston cut the deficit to 6-4 in the bottom half when Ramirez doubled and scored. Justin Wilson replaced Adam Warren and, with two on, retired Ryan Hanigan and Mookie Betts to end the threat.
Miley allowed six runs on seven hits, striking out two in 5 1-3 innings to take his first loss at Fenway since May 2.