"The homer right now doesn't mean anything, because we lost the game," Cervelli said. "I don't care if I hit three homers and we lost. I'm not happy. I've got to be better next time."
The Yankees suffered just their second defeat in nine games as Gerardo Parra opened the 12th by doubling off Phelps. After an out, Cervelli's glove made contact with Paul Goldschmidt's bat on an 0-2 pitch, and Phelps plunked Miguel Montero to load the bases.
Cody Ross drove home the go-ahead run with a single to left-center and former Yankee Eric Chavez cleared the bases with a three-run double to deep right-center as Phelps was handed his first loss.
"You've got to get leadoff hitters out," Phelps said. "You've got to make better pitches with no one on base, especially in an extra-inning game. They're looking to score one run. You've really got to get to making pitches right away."
Heath Bell picked up the victory after pitching a scoreless 11th inning, and the Yankees went in order against Tony Sipp in the 12th.
"We've been good in extra innings," Arizona manager Kirk Gibson said. "We didn't execute as good as we'd like to up to that point, but they hung in there and bonded together and we got the job done here late in the game."
For the Yanks, the discouraging ending came on a day in which they learned that captain Derek Jeter re-injured his left ankle and will not rejoin the team until after the All-Star break.
"It's tough, but we haven't had him yet," Brett Gardner said. "When you don't have guys, you can't really count on them to come back. You've just got to make do with what you've got. I feel like we've been playing pretty good baseball so far and we'll try to keep it going."
Right-hander Phil Hughes started the game and limited the D-backs to two runs and six hits over seven innings, serving up solo homers to Didi Gregorius and Martin Prado and viewing his outing as a significant step forward from his first two starts of the year.
"I felt more like myself, being aggressive, attacking hitters," said Hughes, who walked none and struck out six. "The first couple of starts I was being a little timid and felt out of sorts. I certainly felt like I was back to doing what I do."
Playing his first game for Arizona, Gregorius put the D-backs on top early as he clobbered the first pitch he saw in the big leagues this season, clearing the right-field wall off Hughes in the third inning for his first Major League homer.
Prado's blast went out to left field in the sixth, but the Yankees would happily weather a couple of solo homers every night if they could guarantee Hughes could limit the damage in other spots like he did on Thursday.
Hughes had to make big pitches to get out of trouble in a tight fifth-inning jam, striking out Cliff Pennington and inducing Parra to hit a shallow fly ball to center field to strand two men aboard.
Girardi said that he thought Hughes located his repertoire better than he had in his first two starts against the Tigers and Orioles, to whom he allowed eight earned runs in seven innings of work.
Hughes still was hanging on the hook for a loss upon his exit, because Arizona left-hander Patrick Corbin held the Yankees to one run on two hits over seven innings.
Robinson Cano accounted for the only damage against Corbin, belting his team-leading fifth homer in the sixth inning, a solo blast that struck an advertising board in the right-field bullpen.
The final innings showcased a bizarre sequence of events. Cano was hit in the leg with a bases-loaded pitch from David Hernandez in the eighth inning but was ruled to have swung for strike three, and Kevin Youkilis also struck out to leave the bases loaded.
Joba Chamberlain thought he had witnessed a double play in the ninth on a A.J. Pollock fielder's choice, but Eduardo Nunez missed a tag at third base as Ross slid in safely as Chamberlain howled and Girardi dashed out to protest.
Cervelli's first catcher's interference call of the night followed, tipping Gregorius' bat and knocking the catcher's glove off at the plate. But Chamberlain escaped the ninth, Cervelli homered and the Yanks hung in for a while longer.
"I thought our bullpen did a good job of wiggling out of some jams earlier and giving us an opportunity to win," Girardi said.