Acquired earlier this month from NL West also-rans, they teamed up Thursday to help the Yankees beat the Texas Rangers 4-2. McCarthy threw six more solid innings, Headley delivered another timely hit and New York won for the sixth time in seven games.
"From the beginning of spring training, it's about giving yourself a chance in the postseason," said Headley, obtained this week in a trade with San Diego.
"What an opportunity for me," he said. "I take it as an honor and privilege to be here."
McCarthy improved to 2-0 with a 1.45 ERA in three starts since the Yankees got him from Arizona. He was 3-10 with a 5.01 ERA at the time of the trade.
"I really felt I wanted more pressure," he said. "It's ramped up all the way. I feel like I've responded."
"It's the opposite of how I felt earlier in this year. I was a burden on the team and holding things up," he said.
With the Yankees, the newcomers are now in the thick of the race for the AL East crown and the wild-card spots.
"When you go out and get players that produce, it's a lift for your team," Yankees manager Joe Girardi said.
Texas fell to 3-17 in July and dropped 22 games under .500 for the first time since the final week of the 1988 season.
"Right now, we're just not getting it done," Rangers manager Ron Washington said.
McCarthy limited Texas to one run and four hits in six innings. He struck out five, and fanned Alex Rios to finish off an 11-pitch at-bat that ended the first inning.
Rios almost got even in the eighth with Texas trailing 3-2, hitting a drive off All-Star reliever Dellin Betances that was caught on the warning track in right field.
David Robertson pitched the ninth for his 25th save in 27 chances.
Colby Lewis (6-8) gave up three runs and four hits in 6 1-3 innings. He took the loss, but kept his composure — in his previous start, he got rankled when Toronto's Colby Rasmus bunted for a two-out single midway through the game.
There were no problems with the field at Yankee Stadium, either. New York won 2-1 Wednesday night when a sudden, heavy storm prevented the grounds crew from quickly putting the tarp down in the fifth inning. The rain stopped soon enough, but the field was too wet to continue.
Texas took a 1-0 lead in the third on an RBI single by Elvis Andrus.
Brett Gardner doubled in the fourth and scored on Headley's two-out single off the right-field wall. Headley was acquired from the Padres on Tuesday and beat Texas that night with a single in the 14th inning.
Francisco Cervelli hit a go-ahead double in the fifth and later scored when left fielder Shin-Soo Choo made a fine running catch on Gardner's sacrifice fly for a 3-1 lead. Earlier, Rangers center fielder Leonys Martin ran way back to grab Ichiro Suzuki's drive.
J.P. Arencibia homered in the Texas seventh. Brian McCann had an RBI double in the New York eighth.
"I'm not frustrated, I think it's going to happen, I think we're going to turn the hitting around," Arencibia said.
NOTES: The Yankees evened their home record at 24-24. They have 33 home games left, most in the AL. ... A day after Texas traded closer Joakim Soria to Detroit, RHP Neftali Feliz will inherit the role for the time being, Washington said. ... Yankees SS Derek Jeter got a day off for rest. ... Toronto LHP Mark Buehrle (10-6, 2.86) starts Friday night at Yankee Stadium against RHP Hiroki Kuroda (6-6, 3.88). Buehrle is 1-11 lifetime vs. the Yankees. ... Texas RHP Yu Darvish will remain on regular rest after pitching 4 1-3 innings in the rain-shortened loss, Washington said. ... Texas pitching coach Mike Maddux will miss the weekend series vs. Oakland to see brother Greg inducted into the Hall of Fame. Bullpen coach Andy Hawkins will fill in for Maddux, and Triple-A pitching coach Brad Holman will be the bullpen coach for the three games against the A's.