The visitors took the lead when John Akinde kept his cool after being played in by Gavin Hoyte.
Akinde could have made it 2-0 but lobbed just wide when one-on-one.
Luke Berry headed in Harrison Dunk's cross with 19 minutes to go before Barry Corr won it for the U's when he drilled a low shot into the corner just over one minute later.
Cambridge boss Shaun Derry told BBC Radio Cambridgeshire:
"Football is about fine lines, fine margins, take your chances at the right time, and we sure did that today.
"We were clinical with the two chances that we had, up against a stern opponent.
"We knew it was going to be that in the second game in three days. The turnaround was incredible, we didn't really have a lot of options to go into today's game with.
"It was a physical game and the boys were absolutely dead on their feet, but with with a massive smile on their faces."
Barnet manager Martin Allen told BBC Radio London:
Media playback is not supported on this device
"I thought we were excellent. That's probably one of the best performances of the season for our team.
"First half, we totally controlled the game and had about four good chances to go ahead. Second half, it was always going to be different with the wind but, even so, we were on top.
"After being so comfortable and then to be 2-1 down, it's very disappointing for all the players and the supporters.
Cambridge United scored twice in 90 seconds to beat Barnet and record a fifth win in six league games.