Alan Pardew’s men struggled to break down a spirited Glovers defence and were reduced to 10 men with 21 minutes remaining when Morgan Schneiderlin received a straight red card for appearing to punch Gavin Williams.
But Barnard popped up in the second minute of stoppage time to head home Ndiaye Papa Waigo’s cross and break Yeovil hearts.
The Saints dominated the opening half hour but were unable to test home goalkeeper Alex McCarthy.
Yeovil responded with Dean Bowditch and Craig Alcock going close, before Schneiderlin saw red following his clash with Williams.
A draw seemed inevitable as the full-time whistle approached, but Barnard had other ideas.