DALLAS -- The Boston Bruins moved within four points of the Atlantic Division lead with a 3-2 win against the Dallas Stars at American Airlines Center on Friday.
David Pastrnak broke a tie with 12 seconds to play to cap a three-goal third period for Boston (46-17-10), which trails the Tampa Bay Lightning in the division. The Bruins are seven points ahead of the third-place Toronto Maple Leafs.
[WATCH: All Bruins vs. Stars highlights]
Brad Marchand had one goal and two assists, Tim Schaller scored, and Tuukka Rask made a season-high 40 saves for the Bruins, who are 9-2-2 in their past 13 games.
Esa Lindell and Jamie Benn scored, and Kari Lehtonen made 33 saves for the Stars (38-29-8), who lost their seventh straight (0-5-2). They trail the Colorado Avalanche by four points for the second wild card into the Stanley Cup Playoffs from the Western Conference.
Pastrnak scored while falling a few feet in front of the crease. It was his 29th goal of the season.
The Bruins came off a 2-1 overtime loss to the St. Louis Blues on Wednesday to open a four-game trip against Central Division teams.
"A good win for us and a good bounce-back for the road trip," Pastrnak said.
Video: BOS@DAL: Marchand scores on redirection in front
Boston is 6-15-3 when trailing after two periods. Dallas is 29-2-3 when leading after two.
"This one is a real burner," Stars coach Ken Hitchcock said. "We've got to figure out … we've got 48 hours to get ready to play again."
Bruins coach Bruce Cassidy saw both good and bad in the third-period rally after allowing a shorthanded goal in the final minute of the second period.
"It can become a double-edged sword," he said. "Maybe you lose a bit of that urgency early on, thinking, 'We can get it back.' You have to be careful, but I think it helps mentally knowing you've done it before."
Marchand cut the Stars lead to 2-1 at 1:17 of the third period when he was credited with the goal when a shot by Pastrnak caromed off his left knee at the top of the crease.
The play was close enough to Lehtonen for the Dallas bench to view a replay and consider a challenge.
"We had six looks at it," Hitchcock said. "We also had the call from in the video room here. So, otherwise, we would have made the call."
Schaller tied it 2-2 with a shorthanded goal at 9:47, skating in alone off a pass from Marchand. He lifted the puck into the net after Lehtonen committed and fell forward.
"It was bobbling a little bit, so I thought maybe the goalie would come out a little bit," Schaller said. "I thought if I gave him a little flinch he would react to it. And he did, and I was able to sneak it in."
Lindell ended a 20-game goalless drought 2:26 into the first period to give the Stars a 1-0 lead. Curtis McKenzie passed from behind the goal line to Lindell at the left point, and his wrist shot beat Rask.
Benn tied it 2-2 with a shorthanded goal with 38 seconds left in the second period. Bruins defenseman Matt Grzelcyk fell at the left point, allowing the puck to slide out of the offensive zone, and Benn skated in and slid a backhander past Rask.
"You would think it was a game-changer," Cassidy said. "You go in between periods and you just have to take a deep breath."
Video: DAL@BOS: Schaller nets filthy backhander for SHG
Goal of the game
Benn's goal at 19:22 of the second period.
Video: BOS@DAL: Benn finishes nifty move for SHG
Save of the game
Rask's save on Tyler Pitlick at 4:25 of the first period.
Video: BOS@DAL: Rask shuts down Pitlick's speedy chance
Highlight of the game
Pastrnak's goal at 19:48 of the third period.
Video: BOS@DAL: Pastrnak nets go-ahead goal in final seconds
They said it
"When we get one we get life and we start to feel it's dangerous." -- Bruins forward Brad Marchand
"It's hard to, a lot of time, think about what just happened there and get ready to go again. That's the name of the game." -- goaltender Kari Lehtonen following Dallas' seventh consecutive loss
Need to know
Marchand has 20 points (eight goals, 12 assists) in his past 11 games. … The losing streak for Dallas is its longest since losing seven (0-5-2) from Oct. 25-Nov. 8, 2014. … Rask is 7-0-1 in his past eight starts. … Benn has a six-game point streak (five goals, four assists) and 16 points in his past 14 games (seven goals, nine assists).
Bruins: At the Minnesota Wild on Sunday (7:30 p.m. ET; NBCSN, NHL.TV)
Stars: Host the Vancouver Canucks on Sunday (7 p.m. ET; SNP, FS-SW, NHL.TV)
Video: Pastrnak's goal completes B's comeback in 3-2 win