The British world number three ended an eight-match, 25-month slump against the world number one.
He had not beaten Djokovic since the 2013 Wimbledon final.
They embraced at the net after their three-hour match that left them exhausted because of lengthy games and courtside temperatures that reached as high as 40C.
“It’s taken me a long time to get back to this level and this year I’ve had a lot of close matches with him (Djokovic) and not managed to get it so it’s obviously nice to be able to get a win today,” Murray said.
After each player employed early breaks to split the first two sets, Murray was spot on to begin the final set.
He broke his opponent in the second game to burst to a 3-0 lead and then hung on for his third title on the Canadian hardcourts, and first since 2010