Nicky Nicolau returned to haunt his old Hereford team-mates by scoring the late goal that handed Barnet their first ever win at Edgar Street.
The midfielder, who spent a spell on loan with the Bulls in their Conference days, struck the decisive goal five minutes from time after Hereford had appeared to have fought their way back into the game.
Albert Adomah raced through the Bulls defence inside the first 30 seconds to force a diving save from Wayne Brown.
But goal incidents were at a premium in the opening exchanges with both sides struggling to make constructive moves.
Hereford's Toumani Diagouraga almost opened the scoring in the 28th minute with a fine turn and shot which was parried by Lee Harrison before Max Porter completed the clearance.
Barnet continued to probe and the lively Adomah drove a shot just wide from 20 yards.
Jason Puncheon then got behind the Hereford defence and forced a desperate clearance from Trent McClenahan.
And, as Hereford strove to find a way through at the other end, both Simon Johnson and loan acquisition Gary Hooper had long-range efforts saved.
On the stroke of half-time, Barnet gained a free-kick in a dangerous position 20 yards out but Josh Wright's shot, although beating the wall, gave Brown no problems.
Six minutes into the second period, Adomah was in the right place to crack home the opening goal after Cliff Akurang's shot had been blocked.
But Hereford fought back into the match when their two substitutes combined to create the equaliser, Trevor Benjamin powering home a header from Kris Taylor's corner.
After that, it seemed as if Hereford would be the more likely winners, but their hopes were dashed five minutes from the end when Neal Bishop's shot was parried by Brown into the path of Nicolau who inflicted a third successive defeat on his former club.