The Millers, with new boss Steve Evans officially taking charge for the first time, came racing out of the blocks and were ahead after two minutes. Shrewsbury were unable to clear a corner and eventually big defender Ryan Cresswell looped a header into the net.
James Collins fired narrowly over at the other end shortly afterwards but Rotherham continued to create the better chances and, after Alex Revell’s 20-yarder was deflected just off target, Lewis Grabban drove over from the edge of the area.
The Shrews needed a lift and Gornell obliged deep into stoppage time at the end of the first half when he collected a pass from strike partner Collins and fired a low shot from 20 yards past Rhys Taylor.
Shrewsbury, now unbeaten at home in 30 matches, took the lead three minutes into the second half when Nicky Wroe burst through and rounded keeper Taylor before setting up Cardiff loanee Aaron Wildig for a tap in.
Gornell made sure of the points in the 67th minute when, fed by Collins, he hammered another low shot from just outside the area into the bottom corner of the net for his ninth goal of the season.