In an open game Rotherham took the lead after only six minutes when defender Marc Joseph headed home a Peter Holmes corner.
Dale hit back on the half hour when inspirational skipper Gary Jones burst into the box and rifled home after good play by Rene Howe.
With the home side very much on top, Hill introduced Dagnall and fellow striker Lee Thorpe midway through the second half and their partnership paid real dividends.
On 81 minutes, Thorpe held up the ball well in the box, before finding Dagnall, who controlled it in an instant before firing home from six yards with his left foot.
Five minutes later, after good work by another substitute, Chris Basham, Dagnall produced excellent footwork to evade a challenge and then fire home with his right foot from 12 yards.
By now Rotherham were a completely spent force and Dagnall finished them off in the 89th minute, controlling a wonderful 50-yard Tom Kennedy pass with his right foot and instantly curling the ball into the net with his left from the edge of the penalty area.
With other results going their way, Rochdale are once again just one point away from the play-off places, with three games in hand over most of their rivals and have their destiny very much in their own hands.