Lovren rose at the far post to rifle home his header in the first minute of added time, recalling memories of Liverpool’s 2005 Champions League final comeback against AC Milan and propelling them into the last four with a 5-4 aggregate victory.
Liverpool, 2-0 down after nine minutes, will be joined in Friday’s draw by holders Sevilla, who needed a penalty shootout to edge past Spanish rivals Athletic Bilbao.
Spain will have two sides in the last four after Villarreal beat Sparta Prague 4-2 and 6-3 over the two legs, while Shakhtar Donetsk defeated Braga 4-0 at home to complete a 6-1 aggregate triumph.
Liverpool’s victory at Anfield was greeted by typically exuberant celebrations from manager Juergen Klopp, who spent seven years at Dortmund and would have been no stranger to the quick-fire counter attacks that earned the visitors a 2-0 lead.
Liverpool might have felt they had a slight advantage over Dortmund having snatched an away goal in a 1-1 first-leg draw, but the tables were turned in the blink of an eye after a whirlwind start by the Germans.
Liverpool were slapdash in possession, Dortmund ruthless on the counter as they brutally punishing Liverpool's errors with both early goals starting from the hosts gifting them the ball.
Dortmund played with the same intensity they did when Klopp led them to two Bundesliga titles and a Champions League final, harrying Liverpool all over the pitch and winning back the ball in dangerous areas.
The first goal arrived after five minutes as a rapid break ended with Simon Mignolet saving brilliantly from Pierre-Emerick Aubameyang, only for Henrikh Mkhitaryan to sweep home the rebound.
It was soon 2-0 as Marco Reus powered through the Liverpool midfield and fed Aubameyang to rifle his finish into the roof of the net, beating Mignolet at his near post.
Having never lost at home to German opposition in 13 games, Liverpool were suddenly facing a mountainous climb back into the encounter, but they were given hope three minutes into the second half when Divock Origi raced through and poked his finish past Roman Weidenfeller.