The striker headed home from Merouane Zemmama's cross to help his side move seven points clear of the Championship drop zone.
In an entertaining match, the hosts drew first blood when Neil Harris, on his return to the starting line-up, coolly finished after collecting from Steve Morison's flick-on.
The Lions had several chances to extend their lead but they were pegged back by Tony McMahon's fantastic free-kick and they then fell behind thanks to Scott McDonald's strike.
Hameur Bouazza came off the bench to score on his debut with a free-kick of his own before Lita ensured Boro's first win at Millwall since 1973.
The result is a blow to Millwall's play-off hopes as they would have been hoping to close the eight-point gap on sixth-placed Leeds.
The hosts, looking for their seventh consecutive home win, came flying out of the traps and Morison perhaps should have done better when he hurriedly shot wide from close range.
James Henry struck the crossbar with a fierce 25-yard strike and although Lita was off target with his unmarked header at the other end, Harris gave the hosts a deserved lead in the 15th minute.
David Forde's long goal kick was flicked on by Morison and Harris stole in behind the Boro defence before slotting home to register his first league goal of the season.
Another long-range effort from Henry went narrowly over as Millwall continued to create opportunities.
The visitors were showing plenty of enterprise but they showed little cutting edge in the final third.
That is until Lita burst through on goal after latching on to Julio Arca's pass and although he took the ball round Forde, Darren Purse was on hand to clear the striker's eventual shot.
Davies almost put through his own net shortly before half-time when Henry's cross hit the defender's knee but the ball went narrowly wide.
The Teesside club capitalised on their slice of luck with two goals in four minutes to turn the game on its head.
McMahon brought a lifeless second-half to life with a magnificent 25-yard free-kick that found the top corner of the net in the 58th minute.
Harris should have grabbed his and Millwall's second immediately after but his header produced a fine save from Boro goalkeeper Jason Steele.
The hosts were made to pay for their profligacy in front of goal as McDonald put Boro ahead.
A smart move finished with Zemmama finding the Australian striker and he fired past Forde.
There was a suspicion that McDonald was offside and unsavoury scenes followed as objects were thrown in the direction of a linesman, which prompted referee Chris Sarginson to temporarily call a halt to proceedings and speak to both managers before allowing the game to continue.
Harris spurned another opportunity when he missed the target with a header before Bouazza hauled Millwall level.
The substitute hammered his free-kick from just outside the area past a helpless Steele in the 78th minute.
However, as Kenny Jackett's men piled forward in search of a winner, Lita grabbed the decisive goal seven minutes from time.
Zemmama was once again the provider - his precision right-wing cross was headed in by the former Reading striker.