Barnet were made to pay for a missed penalty as Cheltenham's Jeff Goulding scored the only goal at Whaddon Road.
Scott Brown kept out Mark Byrne's spot-kick after Darren Carter was penalised for handball.
Bees goalkeeper Graham Stack had already denied Chris Zebroski and Shaun Harrad but could not stop substitute Goulding netting from 25 yards.
The win enabled third-placed Cheltenham to keep pace with Gillingham and Port Vale, while Barnet stay bottom.
VIEWS FROM THE DRESSING ROOM
Cheltenham Town Manager Mark Yates told BBC Radio Gloucestershire:
"I thought we did all the pressing for the majority of the game but we just couldn't get the goals we wanted to make the game safe.
"Jeff (Goulding) came on and scored a great goal, when that went in I felt like we could go on and win it.
"He's a very talented player, he's a big strong lad and to see the shot was on, and then execute it like he did, I give every credit to him.
"The last thing we needed was to be sat sixth or seventh in the league table and thinking you can't do anything about it for another couple of weeks.
"We're pleased with the way the season is going. We're obviously disappointed with the last two defeats but we're doing a lot of things right as a team."
Barnet joint head-coach Edgar Davids told BBC London 94.9:
"It is pretty hard to take that defeat but we have to take it on the chin.
"We have to try and play better next time.
"On the other hand we played against a top side and we could match them in the first half.
"We can see the positive side but we have to look at our own mistakes."
Sorry, we were unable to load match stats, please try again.