Pastrnak was set up for the goal on a pass from David Krejci. He tucked the puck between Oilers goalie Mike Smith's legs for his 43rd goal of the season.
Patrice Bergeron scored his 27th goal for the Bruins, who have won four straight and 10 of their last 11 games.
''Typically when we're at our best it's a low-scoring game and we force the other team to stay in the game,'' Boston head coach Bruce Cassidy said. ''I give Edmonton a lot of credit. They've done that lately. They know they're light in their lineup, so good for the American (Hockey) League guys to come up and do that job.''
Sam Gagner had a goal for the short-handed Oilers, who are expected to be without Connor McDavid for much of the month because of a leg injury.
''It's a valuable point for us, but what we want to learn from that game is we need some swagger early on,'' Gagner said. ''Making plays under pressure and having confidence with the puck in the first period would have set us up better. But we clawed our way to a point. There was a lot to like against a really good team.''
The Bruins had 10 shots on net in the first and held Edmonton to just two shots against Boston starter Tuukka Rask.
Edmonton had an 18-9 edge in shots in the second period, but it remained a one-goal game through 40 minutes.
The Oilers tied it on a power play four minutes into the third period as Gagner tipped an Ethan Bear shot up high over Rask for his fifth of the season.
Boston had a chance to win the game with four minutes to play in the third, but Pastrnak hit the post to eventually send the game to extra time.
In the end, the Bruins won another closely contested game.
''I think we're used to playing those kind of games right now,'' Rask said after making 28 saves for the win. ''It's nothing unusual for us. We know that we can play that kind of game and that comes with experience in the playoffs and everything for us, so it's no problem for us.
''Once you move closer to the playoffs these games are going to become more tight checking, so you better get used to it.''
NOTES: It was the second and final meeting between the two teams this season. Edmonton won the first 4-1 in Boston. . Edmonton is depleted. The Oilers were without McDavid (quad), Joakim Nygard (hand), Kris Russell (concussion), James Neal (foot) and Oscar Klefbom (shoulder) and they were also missing Zack Kassian due to a suspension.
Bruins: Play at Calgary on Friday.
Oilers: Host Minnesota on Friday.
More AP NHL: https://apnews.com/NHL and https://twitter.com/AP-Sports
Copyright 2020 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.