BOSTON -- Frederik Andersen made 42 saves to help the Toronto Maple Leafs avoid elimination with a 4-3 win against the Boston Bruins in Game 5 of the Eastern Conference First Round at TD Garden on Saturday.
The Bruins lead the best-of-7 series 3-2. Game 6 is at Toronto on Monday.
[WATCH: All Maple Leafs vs. Bruins highlights | Complete Bruins vs. Maple Leafs series coverage]
Tyler Bozak and James van Riemsdyk each had a goal and an assist for the Maple Leafs.
Andersen made 19 saves in the third period and was instrumental in the Maple Leafs penalty kill going 5-for-6, including 1:33 with the Bruins on a 5-on-3 in the second period.
"He played unbelievable," said Toronto center Auston Matthews, who had an assist. "Obviously, this is do-or-die for us. The pressure is on them to close out the series, and he came up for big for us, as well as a lot of other guys."
Video: TOR@BOS, Gm5: van Riemsdyk roofs PPG from in tight
Noel Acciari had a goal and an assist, and Torey Krug had two assists for the Bruins, who got center Patrice Bergeron back after he missed Game 4 because of an upper-body injury.
The Bruins outshot the Maple Leafs 45-21 and out-attempted them 90-39.
"You've got to give their goaltender credit," Boston coach Bruce Cassidy said. "Both games we've lost we had over 40 shots on net, probably at least 20-something chances, not all on net, but we created chances. So he was very good tonight, let's face it. He made a lot of good saves. The ones we got weren't cheap."
Connor Brown gave the Maple Leafs a 1-0 lead at 6:36 of the first period when he batted the puck out of the air after Krug blocked Matthews' wraparound attempt.
Andreas Johnsson made it 2-0 at 10:12 with a backhand shot from the slot after a pass from Nazem Kadri through Bruins defensemen Zdeno Chara and Charlie McAvoy.
David Backes scored a power-play goal at 9:45 of the second period to cut the lead to 2-1, but Bozak scored 51 seconds later to give the Maple Leafs a 3-1 lead at 10:36.
Van Riemsdyk scored on the power play at 11:55 by stuffing in a pass from Mitchell Marner to give Toronto a 4-1 lead and chase Tuukka Rask, who allowed four goals on 13 shots. Anton Khudobin replaced Rask and made eight saves in his Stanley Cup Playoff debut.
"I didn't think [Rask] had it tonight," Cassidy said. "So we went with Anton, who's been very good for us. And then there's always that part that gets the rest of the team's attention as well. So it's both, I don't want to quantify what percentage was each. Clearly, if I thought he was on, then he wouldn't have got pulled. Let's put it that way."
Sean Kuraly scored with a one-timer from the slot off a backhand pass from the left face-off circle by defenseman Matt Grzelcyk to cut the lead to 4-2 at 17:18.
Acciari scored at 5:56 of the third to get Boston to within 4-3. After Krug's shot went wide, Tim Schaller played it off the back of the net to Acciari, who chipped it in before Andersen could get over.
"They were coming hard, they wanted to tie it up, and I think we might have been playing a little too much on our heels," Brown said. "It's important to keep going to get them and keep playing in their end. They were breaking out a little easier than we would have liked, but at the end of the day, we got a gutsy win down the stretch, and it's a real momentum-builder."
Video: TOR@BOS, Gm5: Brown bats puck out of air for goal
Goal of the game
Bozak's at 10:36 of the second period.
Video: TOR@BOS, Gm5: Bozak snaps puck past Rask
Save of the game
Andersen stopping Krug at 19:27 of the third period.
Video: TOR@BOS, Gm5: Andersen absorbs Krug's wrister
Highlight of the game
Andersen's save on David Pastrnak at 6:52 of the third period.
Video: TOR@BOS, Gm5: Andersen uses his pad to rob Pastrnak
They said it
"We just kept saying to ourselves that we were up a goal in the third period on the road. If you would have written that up at the beginning of the game, we would take it 10 times out of 10. So we just had to stay calm. [Frederik Andersen] was our backbone. We did a great job winning some face-offs, winning some battles down the stretch, and we were able to get the job done." -- Maple Leafs center Nazem Kadri
"We still have a lot of confidence. I think the momentum is still on our side right now even though they won. We had a good pushback, and we're going to take that pushback and hopefully have a good first five minutes up there in Toronto [in Game 6] and go from there." -- Bruins forward Tim Schaller
Need to know
Kadri returned from a three-game suspension for boarding Boston forward Tommy Wingels in Game 1. ... The Bruins are 10-15 all time in Game 6 when leading a series 3-2. ... Toronto has won six of 22 best-of-7 series when trailing 3-2.
Game 6 of Eastern Conference First Round at Air Canada Centre on Monday (7 p.m. ET; NBCSN, CBC, TVAS, NESN)
Video: Maple Leafs stave off elimination with win in Game 5
Complete Coverage of the Stanley Cup Playoffs
Predators vs. Avalanche
Jets vs. Wild
Golden Knights vs. Kings
Ducks vs. Sharks
Lightning vs. Devils
Bruins vs. Maple Leafs
Capitals vs. Blue Jackets
Penguins vs. Flyers