Boston won three of the four games against Toronto this season but trails it by two points in the Atlantic Division.
"It's huge, it's a four-point swing in the standings, but at the same time, we can enjoy tonight but we can't sit on it," Pastrnak said.
Pastrnak gave the Bruins a 3-2 lead with 15 seconds left in the second period when he one-timed a pass at the top of the crease from Kuraly, who intercepted a pass from Maple Leafs defenseman Nikita Zaitsev.
"All I'm thinking really is to get to the puck first, and once I got to it first, I took a look and saw [Pastrnak] coming," Kuraly said. "It doesn't go through all the time; it went through a couple guys, but I thought I'd give it a try and I guess the risk was worth the reward on that one."
The Bruins led 1-0 at 18:21 of the first period when Krejci took a pass from Kuraly and shot from the right face-off dot.
Johnsson tied it 1-1 at 7:37 of the second period when his shot from the slot went off Rask's glove.
Marner gave Toronto a 2-1 lead at 9:30 on the power play when he took a cross-ice pass from Nazem Kadri and shot from the right face-off dot.