Captain Stanislav Angelov scored in the second minute of added time of a match that featured 12 yellow cards and one red, giving Ludogorets keeper Vladislav Stoyanov no chance with a 25-metre shot and a fortunate ricochet.
Levski, chasing their 27th league title, have 67 points with two matches remaining while Ludogorets are a point adrift in second.
However, Levski will most probably play only one more game - - against city rivals Slavia Sofia - because relegated Etar Veliko Tarnovo will not be completing their fixtures.
The Bulgarian Football Union will award Levski a 3-0 win if the match does not go ahead.
The tense encounter at the Georgi Asparuhov stadium ended with Ludogorets reduced to 10 men after Slovak defender Lubomir Guldan was sent off for a second bookable offence five minutes from time.
Levski coach Nikolay Mitov was sent to the stands by referee Georgi Yordanov for joining his players's wild celebration on the field after Angelov's goal.
"We have one more match but this is a huge step towards the title and I don't think we'll miss this chance," said delighted Mitov.
The result was sweet revenge for Levski, who had failed to beat Ludogorets in the previous three matches, with the win coming only three days after the Blues were beaten in a penalty shootout by underdogs Beroe Stara Zagora in the domestic cup final.
The Eagles, as Ludogorets are known in the Balkan country, are based in Razgrad, a town with a population of less than 35,000, but won a domestic treble during their debut season in the top flight.
The visitors wasted two great chances when Brazilian substitute Juninho Quixada shot straight at Levski keeper Plamen Iliev from close range eight minutes after the interval and then did the same midway through the second half.
Ludogorets had keeper Vladislav Stoyanov to thank when he twice parried Guinea-Bissau striker Basile de Carvalho's shots within a minute.
But Bulgaria keeper Stoyanov was helpless following Angelov's shot that sent the Levski supporters wild with delight.