On a balmy night at the intimidating Stadio San Paolo, the Reds fell behind in the 82nd minute when Mertens converted from the spot after Andy Robertson had upended Jose Callejon in the area.
Substitute Llorente – a member of the Tottenham side beaten by the Reds in last season’s Champions League final – then took advantage of a mistake by Virgil van Dijk to bag his first goal for Napoli after joining them earlier this month.
Liverpool have started their Premier League campaign with five successive victories but largely struggled for composure in their Group E opener, while they lacked a clinical edge on a night when they were barracked throughout by a boisterous home support.
They were indebted to a couple of crucial saves by goalkeeper Adrian for keeping the scores level and, though Roberto Firmino and Mohamed Salah went close for the visitors, their errors in the later stages proved costly.
This was their second defeat in Naples inside a year, having gone all the way in Europe’s elite club competition despite losing all three matches away from Anfield in the group stage last season.
It was a tentative start by the Merseysiders, typified by a couple of misplaced passes by Van Dijk, the second of which allowed Napoli to break away, and only Adrian’s reflexes and an offside decision spared Liverpool. The ball was cut back to Fabian Ruiz on the edge of the area and his brace of strikes stung the palms of Adrian before Hirving Lozano headed into an empty net, only for the linesman to correctly raise his flag.
Chances were at a premium thereafter as Liverpool’s Van Dijk and Napoli’s Kalidou Koulibaly – rated among the two best centre-backs in the world – made telling interventions.
There was a suspicion Koulibaly had tugged Salah’s shirt as the Egyptian livewire broke into the box on the half hour but the Liverpool forward remained on his feet and any appeals for a penalty were muted.
Liverpool were gradually growing in confidence despite the crowd hostility, with Sadio Mane’s strike from a narrow angle saved by the legs of Napoli goalkeeper Alex Meret while James Milner’s attempt to find Salah at the back post produced a last-gasp interception by full-back Mario Rui.
The resulting short corner led to the recalled Milner’s delivery being headed inches wide of the far post by Firmino, the visitors’ best chance of the opening 45 minutes on the Brazilian’s 200th appearance for Liverpool.
Despite a promising end to the half, Liverpool were grateful for a world-class save by Adrian a few minutes after the resumption to keep the scores level.
The former West Ham goalkeeper’s fingertips were enough to lift Mertens’ volley from point-blank range over the bar following a tantalising ball to the back post from Rui on the left.
Liverpool were then presented with a two-on-one counter-attack moments later but Mane’s belated decision to square the ball to Salah was horribly misjudged and the chance went begging.
Salah was then presented with an opportunity after Kostas Manolas sliced an attempted clearance, the 27-year-old Reds forward firing across goal which forced Meret into a full-length diving save.
Napoli, though, were gifted a foothold when Robertson, pictured left, was adjudged to have fouled Callejon in the box as he cut in from the right, Adrian getting a hand to the powerful penalty but not enough to prevent the ball from finding the net.
By this stage, there were deafening boos every time Liverpool touched the ball and they never threatened an equaliser.
However, there was still time for Llorente to double Napoli’s lead in the second minute of added time, Van Dijk losing the ball on the edge of the area, which allowed the Spaniard to slot beyond Adrian.