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."
Cheltenham 01 Brown 02 Lowe 03 Jones 06 Elliott 15 Bennett Booked 04 Carter (Goulding - 79' ) 07 Pack 11 McGlashan (Deering - 72' Booked ) 18 Taylor (Penn - 78' ) 14 Harrad 26 Zebroski Substitutes 12 Roberts 17 Andrew 08 Deering 16 Penn 21 Graham 09 Duffy 10 Goulding Barnet 29 Stack 02 Fuller 03 Brown 04 Kamdjo 30 Stephens 32 Pearce 08 Byrne (Nurse - 86' ) 15 Yiadom 38 Davids 11 Holmes 19 Hyde Substitutes 18 Cowler 35 Iro 07 Lee 17 Edgar 20 Weston 10 Nurse 34 Barker