Dvorak started the rally when he ended a five-game goal drought on a penalty shot at 8:15 of the second period to make it 3-1. He gave the Coyotes a 4-3 lead at 3:52 of the third.
"It's good to know we can come back from deficits like that, but we don't need to put ourselves in these kind of situations," Dvorak said. "We can't always rely on coming back from three goals."
Jakob Chychrun had a goal and an assist, and Darcy Kuemper made 24 saves for the Coyotes (8-7-3), who were 1-2-2 in their previous five games. Clayton Keller had two assists.
"We played terrible hockey in the first, our worst period in a long time, then we got a couple of good goals to get back into it and hung on," Coyotes coach Rick Tocchet said. "I'm glad we won, but it's not winning hockey to play that way."
Cam Fowler had a goal and an assist and Max Comtois had two assists for the Ducks (6-10-3), who have lost four in a row and five of their past six games. John Gibson made 21 saves.
"We're disappointed with the result, but there's still some stuff we can build off here," said forward Jakob Silfverberg, who scored during Anaheim's two-goal first period. "It's a steppingstone. … We played with a lot of passion and energy."
Trevor Zegras made his NHL debut; the 19-year-old forward had two shots on goal and was plus-1 for the Ducks in 13:14 of ice time. Zegras won the World Junior Championship with the United States last month and was named most valuable player of the tournament.
Zegras, who played on a line with Silfverberg and center Sam Steel, was the No. 9 pick in the 2019 NHL Draft.
"Obviously with the loss, it was tough for me to show how cool today was," Zegras said. "I tried to play with some confidence. … But it's one of those games you'd love to have back."
Dvorak gave the Coyotes a 4-3 lead when he redirected Chychrun's one-timer from above the circles for a power-play goal.
The Ducks led 3-0 when Silfverberg hooked Dvorak on a shorthanded breakaway. Dvorak scored on a backhand on the penalty shot, the first of three Coyotes goals in 3:47.
"Obviously we needed a goal and needed some momentum," Dvorak said. "We had to put our work boots on and get going and wake up. It was a good comeback win for us."