Ben Scrivens made 23 saves for Toronto, which survived a double-minor against leading scorer James van Riemsdyk in the third period. Van Riemsdyk, who was drafted with the second overall pick in the 2007 draft by the Flyers and played three seasons with them before being traded, was held scoreless in his return to Philadelphia.
Scott Hartnell, playing his second game since fracturing his foot Jan. 22, scored his first goal of the season for the Flyers, who had won three of their last four and are in the middle of a five-game homestand.
Jakub Voracek, who brought a five-game scoring streak into the game, assisted on Hartnell's goal and then scored one of his own on the power play to cut Toronto's lead to 3-2 late in the third period.
But the Maple Leafs got some big saves from Scrivens to hold on.
The Leafs took a 1-0 lead into the first intermission after Kessel outhustled Kimmo Timonen to a puck along the boards with 2:41 left and beat Flyers goalie Ilya Bryzgalov, who made 17 saves, to the far side. The tough-angle goal - Kessel's fourth of the season - came off a smart pass from Tyler Bozak.
Toronto doubled its lead with just under 5 minutes remaining in the second period when Nikolai Kulemin was sprung free on a breakaway by Nazem Kadri and backhanded it past Bryzgalov for his second goal of the year.
Hartnell, who enjoyed a breakout season last year with a career-high 37 goals, got the Flyers on the board with 2 minutes left in the second period off an excellent crossing pass from Voracek.
Voracek's goal came with 8:18 left in the game off an assist from Timonen. The 23-year-old winger, in his second year in Philly, now has five goals and nine assists in the past five games.
Toronto made it 3-1 with 12:08 left in the game on Grabovski's sixth goal of the year. Seconds after the Maple Leafs power play ended, Clark MacArthur's shot right in front of the net was saved but the rebound was kicked right to Grabovski, who backhanded it past Bryzgalov.
Notes: NHL legend Wayne Gretzky was in the house, watching from a suite at the Wells Fargo Center, along with former Flyers goaltender Bernie Parent. . During the game the Flyers announced they traded Mike Testwuide to Calgary for Mitch Wahl. Wahl is currently playing for AHL Abbotsford and will be assigned to Adirondack. . Monday's game marked the second of three meetings between Philly and Toronto this year. The Leafs beat the Flyers 5-2 in Toronto on Feb. 11.