Banks headed the first and sealed victory with a close-range finish after Armand Gnanduillet had put Chesterfield two up in the 73rd minute.
The Spireites were the better side in the first half, with Jay O'Shea almost catching Josh Lillis out with a shot from inside his own half, and deserved the lead Banks gave them in added time when he headed in a Gary Roberts cross at the near post.
Ian Henderson thought he had equalised in the 52nd minute but referee Christopher Sarginson ruled offside after consulting with an assistant and Henderson was frustrated again when he struck a post six minutes later.
The game flowed from end to end until Jimmy Ryan found Roberts on the right and his low cross was swept home from 10 yards by Gnanduillet.
Any hopes Rochdale had were ended in the 79th minute when Roberts capped a fine display with another pinpoint pass to send Banks in on the right for his second.