In an action-packed last 30 minutes, Billy McKenna gave AFC the lead, only for a Fraser Beckett double to give the visitors three points.
Golcar thought they had taken an eighth-minute lead when Michael Fish headed home following a clever corner routine, only to be deemed offside.
AFC had two chances late in the first half, both from free-kicks, but efforts from Jamie Thomas and Carnan Dawson just went wide.
Thomas went close with another set-piece on 59 minutes, sending a free-kick against the post.
Shortly afterwards, however, and the Mechanics took the lead.
Conah Bishop was found inside the area and, having seen his effort cleared off the line, he set up McKenna who was free in the box to score.
Golcar drew level in the 85th minute when a cross from the right ended with Beckett able to fire past the keeper.
Three minutes later, a throw from the right found Beckett, who scored his second to give his side victory.
Defeat means the Mechanics remain fifth in the Hallmark Security League First Division North ahead of Saturday’s home game against second-placed Emley.