The visitors took the lead in the 11th minute. Gayle had twice been denied by Jake Kean, but the keeper could not prevent him at the third time of asking.
Gayle made it two goals in two minutes with a header across goal, before completing his hat-trick just before the half-hour mark.
Jordan Rhodes could have reduced the arrears but blazed over after Olejnik had saved Scott Dann's header.
Campbell then thought that he had got one back for Rovers, only for the linesman's flag to rule his goal out.