"I didn't think I threw all that bad in the first inning," McCarthy said. "I just followed (catcher) Miguel Montero's lead and didn't shake him off one time."
Though his pitch count was 58 through four innings, McCarthy was more efficient in the later innings. He threw 93 pitches in seven innings.
Adam Eaton was hit by a pitch to open the fourth, and Goldschmidt hit a twisting drive into the right field corner that hit off the fence.
Martin Prado then followed with a sacrifice fly to give Arizona a 2-1 lead. Prado's grounder to third with the bases loaded in the sixth was booted by Headley. Two more runs scored to make it 4-1.
Prado has hit in 11 of his last 12 games for a .361 average, and has driven in 19 runs in that stretch.
"I'm taking advantage of the situation," he said. "I had a difficult course over the first few months and it's good to get going this way."
In the seventh, Goldschmidt grounded into a force play with the bases loaded, scoring Aaron Hill.
NOTES: Former Arizona right-hander Ian Kennedy faces his former teammates for the first time Tuesday night. In his four starts with San Diego, Kennedy is 2-1 with a 3.20 ERA. The Arizona starter is undecided. ... The Padres had won five of their past six games at Arizona. . Padres CF Reymond Fuentes made his major league debut and went 0-for-3 with a strikeout. ... The crowd of 16,871 was the Diamondbacks' smallest at home this season.
16 Week Curriculum With Instructions, Lesson Plans & CNG Conversion Kit