John Tavares and Jimmy Vesey scored, and Frederik Andersen made 27 saves for the Maple Leafs (18-6-2), who lost two straight in regulation for the first time.
"We have to take responsibility for what happened in terms of two losses," Toronto defenseman Morgan Rielly said. "We have to look in the mirror. It's not pointing the finger at the other team, saying, 'Wow, what a great job.' It's up to us to be in control of the game, how we play, how we compete."
Vancouver trailed 2-1 entering the third period but scored three straight goals for its first win when trailing after the second period (1-13-1).
"It's been a tough go, and for our team to keep battling and stick to the process tonight, I think it's huge for our group and give us a lot of confidence," Boeser said.
Bo Horvat deflected a Boeser point shot on a power play to tie the game 2-2 at 8:49.
Miller put the Canucks ahead 3-2 at 9:31 when he scored on the rush. Boeser's wrist shot broke defenseman TJ Brodie's stick and the puck bounced off the skate of Rielly to Miller in the slot for a quick shot over Andersen.
"We take a lot of pride in beating a team like that at home twice when we really need wins," Miller said. "We've shown we could beat anybody in the League. We still believe that, even though the record wouldn't necessarily show it."
Nils Hoglander made it 4-2 at 16:53 with a shot on the rush just under the cross bar.
The Scotia North Division-leading Maple Leafs are 13-2-1 when leading entering the third period.
"It just goes to show that anyone in our division can beat you on any given night, and we've got to be good all the time and stay with the process that works for us," Toronto coach Sheldon Keefe said. "Go off script, and you get the results you get here."