Dortmund comes from behind to beat Gladbach 2-1 in Cup
Neither side could force a breakthrough until Gladbach striker Marcus Thuram was left free to head in the opener in the 71st minute.
But Brandt equalized with a twice-deflected shot six minutes later, before former Gladbach player Thorgan Hazard crossed for him to head in the winner.
"Wins like today's, when you really have to dig in, do you good," Brandt said.
Hazard had earlier struck the crossbar in the closest either side had come to scoring.
There was a bad-tempered end to the game with visiting coach Marco Rose shown a red card for protesting.
"It's just as frustrating as two weeks ago," Gladbach's Jonas Hofmann said, referring to his side's 1-0 defeat to Dortmund in the league. "It's bitter and hurts because there was a good chance."
Dortmund's win eases the pressure on coach Lucien Favre. The Swiss tactician, who appeared to injure himself while celebrating a goal, was under fire after claiming just two wins in the previous eight games across all competitions.
Also Wednesday, Leipzig routed Wolfsburg 6-1 away, Eintracht Frankfurt beat St. Pauli 2-1, Werder Bremen defeated second-division Heidenheim 4-1, and Fortuna Düsseldorf won 2-1 against second-division Erzgebirge Aue.
Hertha Berlin defeated second-division Dynamo Dresden 5-4 on penalties. Hertha defender Jordan Torunarigha scored in injury time of extra time to level the game 2-2 and send it to the penalty shootout.
Third-division Kaiserslautern and fourth-tier side SC Verl had shootout wins over second-division sides Nuremberg and Holstein Kiel, respectively.