The 32-year-old Lajovic, an old friend of the world No.1, was left with an emotional feeling after he beat him 6-4 7-6 (8-6) on Friday in the tournament in Banja Luka, Bosnia and Herzegovina.
"It is the biggest win of my career," Lajovic said on court.
"The emotions are very mixed because I'm playing here in front of the home town and I'm also playing against Nole, who is a good friend and he's a hero of our country.
"Beating him, it's something that I didn't even think is going to be possible, but it happened."
Djokovic converted only one of 16 break chances, and missed three set points in the tiebreaker.
The last time Djokovic had lost to a fellow Serb was in 2012 to Janko Tipsarevic in Madrid.
"Dusan is a fantastic person, great guy," Djokovic said, paying tribute to his conqueror.
"He's someone I've known for a very long time, since he started playing professional tennis. So many times on the Davis Cup team together, trained together. I'm happy for him, to be honest. He deserved to win today."
Following his third loss of the year, Djokovic moves on to the Madrid Open next week with his clay-court form far from his best following his early exit at the Monte Carlo Masters.