The visitors had the better of the opening play before, against the run of play, Eoin JESS scored in the 9th minute after an excellent through ball from Cato Guntveit which beat the attempted Jambos offside trap.
Twenty minutes later, the visitors were level when Locke's cross was headed home by Scott Severin, with the Dons central defence posted missing.
The introduction of Moroccan internationalist Hicham Zerouali for Robbie Winters, just after the hour mark, proved to be decisive as, with his first touch of the ball, he fired in a shot which was spilled by McKenzie, allowing Arild STAVRUM to prod the ball home from close range.
Two minutes later, Zerouali was again the architect with a brilliant through ball to GUNTVEIT, who turned his marker before sending a brilliant right foot shot past the keeper from twenty yards.
Rachid Belabed, on for Andy Dow, almost made it four with a thirty yard drive which almost broke the crossbar in two.
Teenager Kevin Rutkiewicz came on for the last couple of minutes, coming on for Norwegian Stavrum, who received a standing ovation from the home support.