The 27-year-old was introduced for Andrej Kramaric in the 46th minute and immediately made an impact in the encounter with his return in front of goal.
Jadon Sancho and Mario Gotze had fired Dortmund ahead in opening 45 minutes before Raphael Guerreiro extended their lead to three goals in the 66th minute.
Following his introduction, Belfodil pulled a goal back for Hoffenheim in the 75th minute which was followed by Pavel Kaderabek's effort in the 83rd minute.
With three minutes left, the Algerian talisman sent the visiting fans to ecstasy with his second goal.
Belfodil who moved to Wirsol Rhein-Neckar-Arena from Standard Liege last summer has notched six goals in 15 outings in the German top-flight this term.
Hoffenheim dropped to ninth in the Bundesliga table while Dortmund remain unmoved at the summit of the standings.