Marking his 300th Bundesliga game as a coach, the Dortmund boss had little cause to celebrate the occasion in the opening 20 minutes, with his side falling 2-0 behind.
But he was rescued by a Marco Reus hat-trick, with the second coming from the spot after Georg Niedermeier's dismissal for the hosts.
And Klopp felt that Dortmund were good value for the win, despite a poor start.
"It was the worst possible start for us," he told the club's official website.
"Perhaps we needed those two goals to respond. In the second half we were great and kept going. We have exploited (the red card) and deserved to win.
"We definitely needed the result. Now we need to continue.
"We have games that are never that far away from each other and didn't want to lose and have a bad feeling in the Champions League.
"In Madrid there will be major problems we have to deal with, as they always cause problems for anyone that goes there. Real is a big favourite.
"First of all though, the guys have to recover as they are very tired after this intense game in Stuttgart."
The result moves Dortmund back up to second after Schalke had displaced them with Friday's 2-0 win over Hertha Berlin.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.