With the victory, the Senators (36-31-14) tied a season-high winning streak of four games.
James Reimer faced 37 shots, making a number of big saves to keep Toronto in the game.
The Leafs (38-36-8) capped off their season with 12 losses in their last 15 games, leaving them below the Senators in the standings.
Milan Michalek had a chance to put Ottawa up 2-0 on a breakaway in the third period, but Reimer was able to get over and make the save along the post.
Toronto had a 23-second two-man advantage midway through the period, but were unable to capitalize.
Spezza opened the scoring at the seven-minute mark of the second with a power-play goal. Karlsson found Spezza alone in the faceoff circle and the Senators captain caught the inside of the post for his 23rd of the season.
Spezza now has 56 points in 56 career games against the Leafs.
Both teams had goals called off in a scoreless first period.
At the eight-minute mark of the first, Toronto's Tyler Bozak had a goal called off immediately due to a high stick, and on the ensuing play the Senators had a goal of their own waived off after incidental contact with the goaltender was called on the play.
The Senators play their final game of the season Sunday night when they take on the Pittsburgh Penguins.
Notes: The Senators were without C Mika Zibanejad, who is undergoing tests for an undisclosed condition, D Jared Cowen (lower body, day-to-day) and RW Bobby Ryan (sports hernia, out for season). LW Matt Kassian was a healthy scratch. The Leafs were without G Jonathan Bernier (left MCL, two weeks), RW Joffrey Lupul (knee surgery, 3-4 weeks), Dave Bolland (lacerated ankle, unknown) and Carter Ashton (knee, unknown). D Carl Gunnarsson was a healthy scratch. D Petter Granberg made his NHL debut.