The visitors were a shadow of the team that put five goals past Augsburg in the season opener last week and only came to life midway into the second half, scoring three times in the last 20 minutes.
Cologne's Dominick Drexler opened the scoring by nodding home at the far post just before the half-hour with the hosts looking far more aggressive than Dortmund, who fell behind for the second consecutive league game.
Hakimi then rose above two defenders to head in a pinpoint Lukasz Piszczek cross at the far post to put them 2-1 ahead as Dortmund found a way past the tiring Cologne defence.
Forward Alcacer, Dortmund's top scorer last season, completed a quick break for their third deep in stoppage time. The Spaniard has scored three goals in their two league games.
"We were too slow in the first half," Dortmund coach Lucien Favre told reporters. "It was a tough game, exactly as we had expected. But with the introduction of Julian Brandt and Hakimi (in the 68th) our game changed."
"We are very satisfied with the win because it was a hard match."
Champions Bayern Munich, who stumbled to a 2-2 draw in their opener last week and are five points behind Dortmund, travel to Schalke 04 on Saturday.