The Belgium winger put the hosts on their way in the 54th minute before adding his second eight minutes later to hand Napoli a great start to 2014.
Napoli were made to work by a Sampdoria side that were twice denied by the woodwork in the second half.
The outcome in Naples allowed Napoli to move just two points behind second-placed Roma, who lost 3-0 at Serie A leaders Juventus on Sunday.
Sampdoria, meanwhile, suffered their first defeat under coach Sinisa Mihajlovic, who took over the Genoa outfit on November 20.
Samp went into the game looking for their first win at the San Paolo stadium since April 1998 but it was the hosts who started brightly.
Samp goalkeeper Junior Costa pulled off a good save to keep out an early Mertens effort and was called again into action in the 11th minute when he went full stretch to repel Gonzalo Higuain's right-footed strike from the edge of the area.
At the other end, Manolo Gabbiadini tried his luck from distance and his powerful attempt was saved by Napoli goalkeeper Rafael.
Samp should have taken the lead in the 33rd minute but Citadin Eder's volley went over the bar.
Before the break, Jose Callejon came close to giving the home side the lead when he got behind Higuain's cross only to fire just wide of the far post.
Napoli picked up from where they left off and were rewarded shortly after the restart. Higuain found Mertens inside the area and his right-footed strike towards the far post beat Costa.
Samp surged for the equaliser and they almost succeeded in the 58th minute only for Gabbiadini's fierce strike from outside the area to hit the crossbar with Rafael beaten.
But it was Napoli who extended their lead in the 62nd minute when Mertens drilled a 25-yard free-kick towards the bottom right corner of goal and out of Costa's reach.
Samp should have reduced the deficit with 12 minutes remaining but Gianluca Sansone's 15-yard attempt struck the far post, and Napoli held on for their 12th win of the season.