Marco Reus put the Bundesliga side ahead from the spot in the crucial UEFA Champions League Group F clash after Robert Lewandowski was held in the box by Federico Fernandez.
Jakub Blaszczykowski added a second on the hour mark, and Pierre-Emerick Aubameyang netted a third after Lorenzo Insigne had pulled one back for the Italians.
The result ended a three-game losing streak in all competitions for Dortmund, and coach Klopp admitted he was not expecting to witness such an open encounter at Signal Iduna Park.
"We knew that this would be a spectacular game," he said. "But I didn’t expect to see so many chances and so much excitement on the pitch.
"We wasted a lot of opportunities, but Pepe Reina also made some great saves.
"We worked hard today and recorded a highly deserved win. However, Napoli was a very tough opponent and it wasn’t easy for us."
The win puts Dortmund second in the pool, ahead of Napoli on head-to-head performance with one match left to play, but defender Kevin Grosskreutz revealed Insigne's strike had left him wondering whether Dortmund had done enough to climb above the Serie A outfit.
"After Napoli scored their goal, I asked Sebastian Kehl if the result was still good enough for us," he said. "Our coach had explained everything yesterday, but I didn’t fully understand it at the time.
"After we scored to make it 3-1 I knew that was enough.
"We wanted to give our fans and ourselves something to celebrate. We deserved to win."
The German side travel to the already-eliminated Marseille for their final group fixture in two weeks' time, knowing a win will send them through to the last 16.
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.