Bayern, who host Bayer Leverkusen later on Tuesday, have 68 points from 29 matches and will increase their lead to 10 points with a victory.
Leipzig were in complete control in the first half but wasted a string of chances, including Alexander Sorloth's powerful header that was palmed wide by keeper Timo Horn in the 41st minute.
Instead it was the hosts who scored first with Cologne captain Hector heading in at the far post two minutes after the restart.
The visitors quickly recovered when Amadou Haidara drilled in a shot from the edge of the box to level in the 59th but a minute later Hector struck again, finding space to charge into the box and beat keeper Peter Gulacsi with a low shot.
Leipzig tried to fight back and even hit the post through Justin Kluivert in stoppage time but Cologne hung on for a crucial win that saw them move level on 26 points with 16th-placed Hertha Berlin, who are in the relegation playoff spot.