The Maple Leafs trailed 3-0 entering the third period, but goals by van Riemsdyk at 6:00 and Matthews at 8:34 made it 3-2.
Stone scored seven seconds later to make it 4-2.
The Maple Leafs came back again when Nylander scored with a wrist shot from the right circle on the power play to make it 4-3 at 12:52. Brassard scored his second at 16:30 for a 5-3 lead, and Stone scored into an empty net at 18:21.
Senators forward Bobby Ryan left the game in 1:24 into the third period after he broke his right index finger.
"We lost Bobby early in the third, and Zack [Smith] was also out (upper body), so we were missing two of our top six forwards down the stretch," Boucher said. "That made it difficult with the way the [Maple] Leafs pushed back in the third. Give them credit, but our guys found a way and showed a lot of character."
Toronto coach Mike Babcock said the Maple Leafs learned why the Senators had success in the Stanley Cup Playoffs last season, when they lost to the Pittsburgh Penguins in the Eastern Conference Final.