Those swings led to another win for the New York Yankees.
Beltran became the fourth switch-hitter to reach 400 home runs when he hit a two-run run homer in the sixth inning and an inning later Headley had a tiebreaking pinch hit double as New York capped a successful 10-game homestand with a 7-5 victory over the Chicago White Sox.
In a game where the Yankees blew had five one-run leads, Beltran gave the Yankees a 5-4 lead with two outs in the sixth when he a drove a 2-2 pitch from the left-hander Zach Duke over the left field wall. By doing so, Beltran joined Hall of Famers Mickey Mantle (536), Eddie Murray (504) and Chipper Jones (468) as the only switch hitters to reach the achievement.
"It's a great moment for him and it's a great moment for us," Yankees manager Joe Girardi said.
Beltran's 116th home run in 2,431 at-bats against lefties also made him the third Puerto Rico native behind Carlos Delgado (473) and Juan Gonzalez (434) to reach 400. He also became the sixth active player with 400 home runs.
"When you play the game of baseball, I never thought I was going to be able to get to the point where I am right now," Beltran said. "I've always been hard-working. When you accomplish something like this it really means a lot to me, to my family, Puerto Rico my country. So it's exciting to be able to hit 400 home runs."
Beltran's home run ensured the Yankees would be able to use their trio of Dellin Betances, Andrew Miller and Aroldis Chapman. There turned out to be little time to celebrate the milestone when Betances gave up three straight hits, including a double to Melky Cabrera to put the game in a 5-5 deadlock.
"Unbelievable," Headley said of Beltran. "It's been a pleasure to be able to play with him the last couple of years and watch him at this point. We spent a few hours working and him trying to help me out. So great to see."
Betances (1-2) finished the seventh by striking out Alex Avila with runners on second and third. Following a two-out walk to Didi Gregorius, Headley roped a double off right-hander Matt Albers that one-hopped the warning track and bounced off the center field wall.
On May 5, Headley had a .151 average but when he clapped his hands upon reaching second, it had climbed 49 points.
Once Headley put the Yankees ahead for the final time, Andrew Miller struck out two in the eighth. After Brian McCann homered in the eighth, Aroldis Chapman faced Jose Abreu in a memorable 12-pitch at-bat that ended with a groundout and recorded his third save as the Yankees won for the seventh time in 10 games.
"We're swinging the bats," Girardi said. "We're scoring runs. We're winning the close games. I feel a lot better."
By allowing the late hits, the White Sox (24-14) were unable to win a series in New York for the first time since 2005. Chicago also ended a six-game road trip with four losses.
"You're playing a team that's trying to scratch and claw too," Chicago manager Robin Ventura said. "It's a good game, back and forth, we just couldn't hold it. We'd get a lead, they kept fighting back, and even for us, late, the seventh inning you end up tying it back up, but we just couldn't pin it down."
"It just happens we were on the wrong end of things," White Sox right fielder Adam Eaton said. "That sums up our road trip."
Before Beltran homered, he had a first-inning sacrifice fly. The Yankees took a 3-2 lead in the third on an infield single by Starlin Castro and a bases-loaded walk by Dustin Ackley.
Eaton gave Chicago a 2-1 lead on a long home run off Masahiro Tanaka into the back of the New York bullpen beyond the right-center field fence in the third. Eaton then drove in a run with a sacrifice bunt in the fourth.
Avisail Garcia had three hits, including an RBI single in the second for Chicago's first run.
Neither starting pitcher lasted six innings.
Gonzalez allowed three runs, five hits and five walks in 4 2/3 innings while Tanaka allowed four runs and eight hits in five innings.
NOTES: LHP CC Sabathia (strained left groin) threw about 50 pitches in a simulated game as he pitched to IF Ronald Torreyes and IF/OF Dustin Ackley. Sabathia also did some fielding drills such as making pickoff throws and covering first base. Sabathia reported no physical difficulties and if nothing goes wrong, he will likely start Friday in Oakland. ... Sunday marked the 75th anniversary of Hall of Famer Joe DiMaggio starting his record-setting 56-game hitting streak with a single off Chicago's Eddie Smith. White Sox manager Robin Ventura had a 58-game hitting streak at Oklahoma State and said he doesn't think anyone will get close to 56 games. "I can't imagine a guy getting within 10," Ventura said. "It's just harder. If anybody watched the end of our game yesterday you see what's possible." ... Chicago was charged with an error for the first time in 13 games and according to the Elias Sports Bureau, it was the longest in team history.