Lincoln City 2 Macclesfield Town 1
The Imps had the better of the opening half, but were forced to defend for long spells after the break as Macclesfield went on all out attack.
City pulled all 11 men back but somehow managed to hang on until the final whistle with the win keeping them in the top two.
Macclesfield looked nothing like a bottom-of-the-table team and early on Matt Tipton broke into the box but his low shot was saved by City keeper Alan Marriott.
David Morley then shot narrowly wide before Lincoln went in front on 14 minutes with a well worked goal.
Mark Stallard found Jamie Forrester and the former Leeds striker superbly flicked the ball into the path of Scott Kerr. The midfielder burst into the box and rounded keeper Tommy Lee before firing into the empty net.
Kerr almost turned from hero to villain seven minutes later when his misplaced pass let in Tipton but the striker, back at Macclesfield on loan, smashed his shot against the outside of the post.
Lee Frecklington hit a 20-yard free kick narrowly over just before Lincoln increased their lead five minutes before the break.
Jeff Hughes sent over an in swinging corner which was knocked back by Forrester and Lee Beevers hit the back of the net with a thunderous shot. The goal was allowed to stand despite Town's complaints that the ball had gone out of play before reaching Forrester.
Town pulled a goal back in first-half stoppage time when a Kevin McIntyre free-kick was firmly headed home by Rob Scott.
Stallard and Frecklington both went close for Lincoln before Macclesfield took control of the game in the final 20 minutes.
Spencer Weir-Daley was just unable to get on the end of a Tipton cross. Then, an excellent Danny Swailes pass released Tipton, but with the Lincoln keeper stranded on the edge of the area, he was unable to find the net.
Macclesfield's final chance came right at the end when Scott headed a half chance wide of the post.