The Maple Leafs allowed a two-goal lead to get away in the second period, regained the advantage in the third and then lost it again when Edmonton's Jordan Eberle scored his 25th of the season with 4:04 to go in regulation.
Joffrey Lupul, who had opened the scoring 40 seconds into the contest, fired a shot in overtime that Connolly got a stick on for the winning goal.
Taylor Hall produced the only second-period goal to create a 2-2 tie.
James Reimer made 29 saves for the Maple Leafs, who snapped a four-game losing streak. Toronto is 1-4 on a six-game road trip that concludes Saturday in Vancouver.
Khabibulin allowed all four goals on 26 shots.