Hosts Peterhead were first to threaten after just two minutes when Smith had to look sharp to clear from ex-City favourite Rory McAllister.
The visitors responded immediately when Trouten was unlucky to see his header from a Barr cross instinctively saved by Graeme Smith in the Blue Toon goal.
However, Jim McInally’s men shocked City when they opened the scoring after seven minutes. Smith failed to gather a McAllister cross from the right and COX was on hand to blast the ball into the roof of the net.
A Steven Jackson free-kick in the 41st minute was saved by Smith at the second attempt but with it looking very much as if City would go in at the break one goal down, they levelled the match with seconds of the half remaining.
Barr picked up the ball wide on the left and drew in Sharp before delivering an inch-perfect cross into the Peterhead box for JACKSON who glanced a header well beyond Smith’s reach.
The second-half was only two minutes old when McAllister rifled an angular drive just past Smith’s right-hand post but City were beginning to assert themselves and McLean curled in a right-foot drive after 58 minutes which Smith did well to save.
A Trouten pass three minutes later provided an opportunity for Derek Carcary but his shot hit the side-netting.
City created another chance a minute later when Barr left Cowie standing before releasing Carcary with a great pass and when Del’s cross came into the box it was just missed by Jackson.
However, the Blue Toon scored the decisive winning goal in the 73rd minute.
BROWN looked to be in an offside position as Cowie played the ball through the City defence but the youngster kept his composure to slot the ball into the corner of the net.