Nainggolan curled in his first from the edge of the penalty early in the first half and scored again with a run from the halfway line in the 56th minute.
Earlier, a controversially converted Carlos Bacca penalty gave AC Milan a 1-0 win at Sassuolo as the losing side argued that the goal should have been disallowed because the Colombian forward touched the ball twice.
Second-placed Roma's win moved them on to 59 points, seven behind Juventus who brushed aside Empoli 2-0 on Saturday, and left Inter stuck in sixth place with 48, one more than Milan.
Napoli have 54 points, five points behind Roma, in third after Saturday's 2-0 home defeat by surprise package Atalanta, who are fourth with 51.
Nainggolan has been the driving force behind Roma's run of eight wins from 10 league games and he gave another demonstration of his power and ability at San Siro.
He opened the scoring after 12 minutes when he cut inside his marker and beat Samir Handanovic with a shot that curled and dipped viciously.
Inter had Roma on the back foot for much of the first half but, just as they seemed poised to equalise, Nainggolan struck again as he picked up the ball inside his own half, burst forward and scored from the edge of the area.
Mauro Icardi pulled one back for Inter with nine minutes left but the hosts were caught on the counter-attack when Gary Medel scythed down Edin Dzeko from behind, leaving Diego Perotti to stroke home the penalty.
Sassuolo were left fuming after Bacca's unusual penalty in the 22nd minute. Bacca sent the ball into the corner but slipped as he took the kick, with replays suggesting that, in doing so, he may have touched the ball with both feet.
Sassuolo, who had missed their own penalty minutes earlier when Domenico Berardi sent his shot wide, immediately surrounded the referee but their protests were waved away.
Sassuolo had two further penalty appeals turned down in the second half and were also foiled when Milan goalkeeper Gianluigi Donnarumma, celebrating his 18th birthday, made a fine save to turn away a deflected Berardi shot.
Milan coach Vincenzo Montella said his side were due a lucky break.
Ciro Immobile converted a second-half penalty, controversially awarded for handball by Ali Adnan, to give fifth-placed Lazio a 1-0 win at home to Udinese.
(Nestorovski 31-P) Sampdoria 1
(Birsa 12, Castro 61) Pescara 0
(Stoian 10) Cagliari 2
(Pedro 32, Borriello 69)
(Ntcham 90+4) Bologna 1
(Immobile 72-P) Udinese 0
Sassuolo 0 AC Milan 1
Inter Milan 1
(Icardi 81) Roma 3
(Nainggolan 12, 56, Perotti 85-P)
P W D L GD Pts
26 22 0 4 38 66
26 19 2 5 34 59
26 16 6 4 31 54
26 16 3 7 16 51
26 15 5 6 16 50
26 15 3 8 14 48