Montreal came into the final period trailing 1-0 but got the equalizer when Pacioretty set up Andrei Markov's game-tying score 2:26 into the period.
Then with 6:42 remaining, the Canadiens were on a power play when Brendan Gallagher sent the puck to the front of the net where it bounced off the skate of Phoenix defenseman Michael Stone and into the net.
Pacioretty was credited with the goal and later added an empty-netter for the Habs, who extended their unbeaten streak against the Coyotes to 14 games.
Carey Price made 26 saves.
Mikkel Boedker scored and Mike Smith stopped 25-of- 27 shots for Phoenix.