The Senators were without defensemen Victor Mete and Nick Holden, and forwards Austin Watson, Connor Brown and Dylan Gambrell, who are in NHL COVID-19 protocol.
"I'm proud of the group with the guys that were out and the effort we gave," Senators coach D.J. Smith said. "If we keep playing with that effort and that hunger, not only will wins come, but the morale in general will be better."
Sanford scored off the rebound of a Brady Tkachuk shot 1:14 into the game to give Ottawa a 1-0 lead.
"That was a heck of a play by [Tkachuk]... It's always nice to get the first one out of the way," Sanford said. "I think this was kind of a 'prove ourselves' game. … For us to come in, play hard like that, not back down and really try to go after it was impressive. It's obviously tough we didn't come out on top, but I think this was a really good game for us to build off of."
Marchand scored on the power play at 5:12 of the second period to tie it 1-1. Pastrnak's shot from the left face-off circle went in off Marchand, who was standing next to the right post.
Forbort scored at 10:58 to give Boston a 2-1 lead, but Zaitsev tied it 2-2 at 13:09.
Pastrnak nearly restored Boston's lead at 16:04, but Murray saved his shot with the paddle of his stick.
Bergeron scored at 18:40 to give the Bruins a 3-2 lead, batting in the bouncing puck after it deflected off a broken stick at 4-on-4.
"I was hoping [the puck] wasn't going to touch [the broken stick]," Bergeron said. "When it did, I was trying to make sure I was able to control it right away, try to surprise the goalie and get it on net as quickly as possible."
Ottawa went 0-for-6 on the power play. Boston was 1-for-3.
"We've got to get one on the power play, but in saying that, the ice wasn't great," Smith said. "I thought our penalty kill did a heck of a job too. We'd certainly like to get one on the power play, but at the end of the day, our 5-on-5 game I really liked."
NOTES: Bruins forward Trent Frederic left the game at 16:30 of the second period with an upper-body injury after taking an open-ice hit from Josh Brown. … Cassidy is the sixth coach in Boston history to reach 200 wins, joining Claude Julien (419), Art Ross (387), Milt Schmidt (245), Don Cherry (231) and Gerry Cheevers (204). ... It was Bergeron's 28th goal in 74 games against the Senators, his most against any opponent. He has scored 25 goals in 60 games against the Florida Panthers. … Ottawa forward Egor Sokolov had one hit in 7:42 in his NHL debut, and defenseman Erik Brannstrom had one hit in 14:52 in his NHL season debut. ... Connor Brown's games-played streak ended at 384; it was the fourth-longest in the NHL.