Cheltenham secured their first win in eight games to boost their flagging promotion bid and keep Barnet mired in relegation trouble.
The Bees almost took a first-half lead but home keeper Jack Butland did well to keep out efforts from Mark Byrne and Ricky Holmes.
Kaid Mohamed put the hosts ahead after a strong run and one-two with Jermaine McGlashan ended in a neat finish.
Jimmy Spencer's cool finish from Luke Garbutt's free-kick ensured the win.
VIEWS FROM THE DRESSING ROOM
Cheltenham Town manager Mark Yates told BBC Gloucestershire:
"The aim is to pick up as many points as we can and if we can get to where we want to get to with a bit of momentum then brilliant.
"We thought we should have two penalities, we thought there should have been a sending off but we kept at it.
"We've got five games left, we're nearer where we want to be and the players can take tremendous heart from today
"Hopefully we can go and get a result against a decent Rotherham side but it's going to be tough."