With the loss, the D-backs fell to 4 1/2 games behind the first-place Dodgers in the National League West.
"He was kind of vintage Jake," D-backs manager Kirk Gibson said. "He threw the ball well and used all his pitches well. He has a good assortment of pitches and used them in any count. He made the pitches when he had to. We had some pressure on him occasionally, but he's a very good pitcher. That's why they got him. You've got to tip your hat."
Peavy (9-4) was making his first start for the Red Sox after coming over from the White Sox in a three-team deal just prior to the Deadline. He struck out seven and walked two before leaving after a leadoff single in the eighth.
"Outstanding debut for us," Boston manager John Farrell said. "A number of swing and misses with three different pitches -- fastball, cutter and his slider. He was efficient and as advertised. Strong competitor, made a couple of big pitches when he needed to."
The D-backs took a 1-0 lead in the fourth inning when Paul Goldschmidt hit an 0-2 fastball into the seats just beyond the Red Sox's bullpen in right-center.
The Sox tied it with a homer of their own off the bat of Shane Victorino in the fifth.
That was the only damage that Arizona starter Patrick Corbin (12-3) allowed through the first six innings, though, the left-hander had to pitch out of a bases-loaded jam in the second and allowed a pair of hits in the third.
"We faced a very good pitcher tonight," Farrell said of Corbin. "Might be one of the top lefties in all of baseball -- not just the National League -- and we saw dominant-type stuff."
Finally in the seventh, there was a trouble Corbin could not escape.
The Red Sox opened the inning with three straight singles, the final of which scored Stephen Drew and gave Boston a 2-1 lead. Right-hander Will Harris came into the game and allowed a sacrifice fly to Victorino to increase the Red Sox's lead to 3-1.
"I felt all right," Corbin said. "I just was leaving some pitches up today. I was getting ahead of guys, but the pitches that were getting hit were up. They had some good swings and some good at-bats today."
The D-backs chased Peavy when Wil Nieves led off the eighth with a single. Reliever Craig Breslow came on and hit Cliff Pennington with a pitch before Gerardo Parra grounded a single to left to load the bases.
Once again, Boston went to its bullpen, this time for Junichi Tazawa. Aaron Hill greeted him with a bloop single to left. Nieves scored on the hit to cut the lead to 3-2, but Pennington was thrown out at the plate trying to score from second.
"You know, we're aggressive," Gibson said of third-base coach Matt Williams' decision. "He made a read. He's the guy on the baseline. He's well prepared for it. It was his read. I make mistakes. Matty makes mistakes. Players make mistakes. We stand behind each other. It's part of the game. Everything doesn't work out the way you want it to sometimes."
The D-backs were not able to get home another run in the inning, as Tazawa fanned Goldschmidt and got Eric Chavez to fly out to left to end the inning.
After the game, Williams said he wished he had made a different decision.
"I saw Jonny going to his left, and I thought we had a chance there," Williams said. "Clearly overaggressive on my part. If had it to do over again, I'd probably hold him there and let Goldy hit. Clearly a mistake on my part."
The Red Sox added a pair of insurance runs in the eighth on a Jarrod Saltalamacchia homer off reliever David Hernandez.