Ritsu Doan scored the winner in the 111th minute, curling a free kick past the wall and Kaiserslautern keeper Andreas Luthe to avoid a first round slip-up for Freiburg, who narrowly missed out on a Champions League spot last season with a sixth-place finish.
Marlon Ritter’s sensational shot from 50 metres out had caught Freiburg keeper Mark Flekken out of his goal and put the hosts in front in the 33rd minute.
Read Also: EPL: Werner accepts 50% pay cut to force through Chelsea exit
Fellow Bundesliga club Hoffenheim were also forced into extra time by fourth division club Roedinghausen but scored twice in three minutes to avoid a penalty shootout.
Promoted Schalke 04 had an easier afternoon with a 5-0 victory over fourth-tier club Bremer SV while Borussia Moenchengladbach fired nine goals past fifth-tier Oberachern in a 9-1 victory.