Torey Krug scored the winning goal only 34 seconds into the extra period. It was his seventh goal of the season.
It appeared the Bruins would win in regulation, but the Penguins' Sidney Crosby scored with three-tenths of a second remaining in the third period to tie the game at 3-3 and force overtime.
James Neal scored a pair of goals for the Penguins.
Entering Monday's game, Pittsburgh had won seven consecutive regular-season games, but the Bruins boasted a four-game sweep in the conference finals last spring.
The Penguins dominated the first 10 minutes of the opening period, and if Rask wasn't on top of his game, Pittsburgh easily could have had at least a two-goal lead. Fortunately for Boston, it caught a few bounces and quickly took over momentum and finished the first period with a 2-0 lead.
Eriksson notched his fifth goal of the season at 12:27 of the period to give Boston a 1-0 lead. Carl Soderberg gained control of the puck in the neutral zone and took it into the offensive zone before dishing to Eriksson. The pass was a bit behind the streaking forward, who made a nifty move by passing it to himself through the legs before beating Marc-Andre Fleury to the five-hole with a backhander.
Soderberg's contributions continued. He drew a penalty at 15:34 of the first to give Boston its first man advantage of the game, and the Bruins quickly capitalized when Smith scored at 15:43 for a 2-0 lead. Soderberg had the puck in the corner when Smith broke for the net before connecting on his fifth goal of the season.
It didn't take long for the Penguins to cut their deficit at the start of the second period. Neal scored his first of the game when he was all alone in the high slot, received the pass and beat Rask only 37 seconds into the period.
Neal notched his second of the night to tie the game at 2-2 at 11:09 of the third period. His one-timer from the left face-off dot beat Rask to the high glove side.
Chara scored his fifth of the season at 14:45 of the third period. His shot from the right point found its way through traffic and beat Fleury to give Boston a 3-2 advantage.
With their goalie pulled for the extra attacker, the Penguins tied it with three-tenths of a second remaining in regulation when Crosby knocked the loose puck past Rask.
With the win, Boston has 34 points to remain atop the Eastern Conference standings. The Bruins are 4-0-1 in their past five games.
Up next: The rest of the week for the Bruins is interesting. They'll travel to Detroit to face the Red Wings on Wednesday night at Joe Louis Arena before hosting the New York Rangers at 1 p.m. Friday at TD Garden. Boston will then host the Columbus Blue Jackets at 7 p.m. on Saturday.