Kompany remains in hospital after collapsing following a training session on Friday, leaving Danks to take charge for the trip to Freiburg.
Dayot Upamecano and Serge Gnabry scored to give Bayern a two-goal lead at half-time, but Tom Bischof's own goal handed Freiburg a lifeline.
Bayern had to withstand late pressure before Michael Olise scored in stoppage time to secure three valuable points and maintain their position at the top of the Bundesliga.
Speaking to DAZN after the match, Danks revealed that Kompany had quickly contacted him on WhatsApp.
"I just opened my phone to a WhatsApp from Vince straight away saying 'well done', and he was happy," Danks said.
"So I just replied saying, 'Brilliant, now rest,' and sent him a kissing emoji. So hopefully he rests up."
Danks was also pleased with Bayern's response to a challenging week, praising his players for their resilience against a Freiburg side in good form.
"Really pleased with the performance," he said. "We always knew it was going to be such a difficult place to come. They're a top team; they're in really good form."
He added that Bayern had shown character when Freiburg threatened to find an equaliser late in the game, with the home crowd driving their team forward.
Bayern will now turn their attention to the DFB-Pokal clash against Magdeburg before facing Borussia Dortmund on Saturday in a crucial Bundesliga showdown that could strengthen their position at the summit.