Marc Corcoran took all of two minutes as a substitute to hammer in a late winner for St Mirren against a hard-working Brechin side.
John Sutton fired over as the League leaders sought to secure early supremacy but Darren Smith indicated that Brechin were out for their second League win with a clever run which was only halted when he stumbled.
Charlie King broke through for City but Ian Maxwell deflected the ball out for a corner before Kevin Byers forced Chris Smith into a smart save.
City went ahead in the 24th minute when Saints were not alert as David White rose to head in Ally Mitchell's free-kick from wide on the left.
Mitchell nearly undid his good work with a short back-pass to Craig Nelson but the angle was too acute for Stewart Kean to capitalise.
Kean and Sutton collided with each other on the edge of the Brechin box but the ball fell to Charlie Adam and the midfielder hammered in a splendid low drive from 25 yards which left Nelson helpless.
Saints were awarded a penalty just before the hour when Sutton was impeded by Scott Walker and Kean slotted the spot-kick home with assurance.
Brechin hit back four minutes later. Saints failed to clear a City raid and Darren Smith stepped in to smash home the equaliser from 12 yards.
Corcoran swooped nine minutes from time, driving in a left-footed cross-shot after Sutton had teed him up from David van Zanten's free-kick. Grant Johnson was given a second yellow card in the last minute to complete Brechin's misery.