Defender Kerr Waddell scored the only goal midway through the second half as Jonatan Johansson's side moved up to fourth place in the Ladbrokes Championship.
It was only a third league defeat of the season for the league leaders, who had Marcus Fraser sent off in stoppage time.