It was Harlequins' first Premiership win since early February, but the Titans did not roll over for the hosts as they searched for their first win of the season since being promoted.
Quins surged into a commanding lead with tries to fullback Gavin Duffy and winger Ugo Monye and the boot of Dunne leaving the score well in their favour at 17-3, but the Titans struck back through a Jon Pritchard try.
Titans fly-half Phil Jones converted and the gap was narrowed to 17-10.
But Quins soon took control as prop Kerry Jones went over for their fourth score, clinching the bonus point, and the conversion from Dunne put the hosts further ahead.
Harlequins never looked back and they had the game wrapped up 14 minutes after the break when Dunne slid over for his try. A second try each for Jones and Duffy only added salt to the wounds of the beleaguered Titans side, who seem destined to end the season without a point.
For NEC Harlequins:Tries: Duffy 2, Monye, Jones 2, DunneCons: Dunne 5Pen: Dunne
For Rotherham Titans:Try: Pritchard, WoodCons: Jones, BensonPens: Jones 2