Magnus Paajarvi scored twice, Zack Smith had three assists and Anders Nilsson made 35 saves for Ottawa (25-41-6), which has been eliminated from Stanley Cup Playoff contention.
"That was, quite truthfully, probably our best game of the year," Senators coach Marc Crawford said. "If you look at all the things that went in our favor, right from the goaltending to the defense, how well a lot of them skated tonight, how well they hit, how well they finished checks, moved the puck. We had four lines that all played good."
Cody Ceci scored with a wrist shot from the slot to give the Senators a 1-0 lead at 6:36 of the first period.
Brian Gibbons swung his stick at a loose puck while falling to the ice, and it trickled under Sparks' pads to make it 2-0 at 6:48 of the second period.
Rielly scored his 20th goal of the season with a wrist shot from the right face-off circle to make it 2-1 at 12:33.
Paajarvi took a cross-ice pass from Rudolfs Balcers and scored with a snap shot to the top left corner to give the Senators a 3-1 lead at 13:51. Paajarvi scored his second of the game with a wrist shot to make it 4-1 at 18:50.
"We wanted to counter on them," Paajarvi said. "We know they're a really, really good counter team, a lot of fire power. We [don't] necessarily have that much right now, so we've got to stick together and play together and be solid."
Tavares scored on a 5-on-3 power play to make it 4-2 at 5:13 of the third period. It's the first time Tavares has scored 40 goals in a season, and it was also his 700th NHL career point.
"It's really hard to really feel good about something like that now, considering the way tonight went," Tavares said. "It's obviously nice, and it's a credit to my teammates and the team I'm playing on."
Anthony Duclair gave the Senators a 5-2 lead at 8:36, and Oscar Lindberg scored at 14:21 for the 6-2 final.
"We've given up way too many goals," Maple Leafs coach Mike Babcock said. "You can't take the puck out of your net like we have and have success.
"The bottom line is we all know how to play defense, we all know where to stand and we're not doing a good enough job, and tonight we weren't good enough."