The Bees started well with City keeper Ayden Duffy making a diving save to keep out a Nathan Elder header.
But Lincoln soon settled down and were unlucky in the 28th minute when a long-range shot from Louis Dodds came back off the post.
City took the lead six minutes before the break when Gary King sent in a harmless ball from the left which completely fooled Brentford keeper Simon Brown. He let the ball bounce off his body and roll into the net.
Brentford equalised on 45 minutes when a cross from Kevin O’Connor was headed in by Elder.
But Lincoln edged in front in the 67th minute through a Jamie Forester free-kick. And the hosts added a third goal when Lee Frecklington headed home a Paul Green cross.