The striker, who has bagged five goals in his last five games, gave Rangers the lead midway through the second half before killing the tie from the penalty spot with minutes remaining.
This was QPR's eighth consecutive clean sheet in the Championship, breaking the club's previous record.
It was a slow start to the match as QPR dominated the early possession without threatening the Barnsley defence.
QPR should have had the lead in the 37th minute but were denied by a double-save by Jack Butland. First Charlie Austin's close-range header was kept out before Alejandro Faurlin saw his follow-up blocked by the Barnsley keeper.
Rangers dominated the closing stages of the first half but were unable to make the breakthrough.
Former QPR defender Peter Ramage had the first opportunity of the second half but his header went over following a Barnsley corner.
Dunne again caused problems for the Barnsley defence when he met another corner but could not direct it on target, before Faurlin's effort was struck straight at Butland.
QPR took the lead on 67 minutes when substitute Junior Hoilett, who had earlier replaced Faurlin, picked out Austin with a cross and the striker coolly slotted past Butland to score his fourth goal in five matches.
Rangers continued to dominate the play and Clint Hill put a header over the bar from a corner.
The three points were sealed for the home side with three minutes left on the clock when Austin was clipped in the area by Martin Cranie and the in-form striker picked himself up to slot home from 12 yards.
Javier Chevanton came to make his QPR debut and almost added a third in injury time, but his effort from distance flew over the bar.