Barnsley, who themselves occupied bottom spot at the start of the year, saw their impressive six-match unbeaten run in the league under David Flitcroft come to an abrupt halt.
Jon Stead struck in either half, Liam Fontaine hit his first goal since April 2010, and Lewin Nyatanga and Steven Davis also got in on the act to hand the Robins their first win in three matches and move them to within three points of Barnsley, who sit one place above the drop zone.
The visitors responded with Chris O'Grady's first goal since joining on loan from Sheffield Wednesday, and further strikes from substitutes Tomasz Cywka and Jason Scotland.
The hosts seized the advantage after 16 minutes when Paul Anderson's left-wing corner was flicked on by Marvin Elliott and Stead added the final touch with his head.
It was 2-0 on 35 when Brendan Moloney provided the cross and Fontaine was the unlikely scorer from six yards out. Then just seven minutes into the second half, Sean O'Driscoll's men all but put the game to bed when Fontaine headed Steve Davies' cross into the path of Stead and he doubled his personal tally.
They added a fourth for good measure three minutes later, Lewin Nyatanga profiting from slack defending to head in from inside the six-yard box.
O'Grady stabbed in after a goalmouth scramble to reduce the deficit before the hour-mark but Barnsley's flicker of hope appeared to fade when Davies intercepted David Perkins' poor pass to slot past Luke Steele.
Cywka, introduced from the bench just after the hour, volleyed in from the edge of the box with eight minutes left and Scotland fired in from long range to round off the scoring in stoppage time.