Kostka, who played 35 games for the Leafs last season, scored the second of three Blackhawks goals in the middle period, all of which came during an 11-minute flurry.
Brandon Pirri and Bryan Bickell also scored for Chicago, which won for the fourth time in five games.
Corey Crawford made 19 saves in the victory.
Nazem Kadri scored and Jonathan Bernier stopped 40-of-43 shots for Toronto, which dropped a second straight.
Video of Victoria’s Secret models trying to 'twerk' hits Instagram
Exploding whale video goes viral on Internet