The Foxes were staring at a sixth straight loss in all competitions, a run which has seen them slide towards the Premier League relegation zone, when Mathias Jensen fired Brentford ahead.
But Barnes showed the Bees' defence a clean pair of heels as he raced away to score a fine second-half equaliser.
Barnes' strike denied Brentford boss Thomas Frank a 100th win in charge, but they at least stretched their unbeaten run at home to 10 matches.
Under-pressure Foxes manager Brendan Rodgers made a bold call by dropping goalkeeper Danny Ward in favour of Daniel Iversen, but his wait for a first clean sheet since the World Cup break goes on.
Iverson, making his Premier League debut, was kept busy in the opening stages, holding Yoane Wissa's drive before Bryan Mbeumo headed Rico Henry's cross wide.
Leicester looked nervy at the back but still threatened in attack, with Barnes curling a shot inches wide of the far post.
Patson Daka nodded Ricardo Pereira's cross wide and then blazed over after his own header was blocked by Ethan Pinnock.
But the Bees are brimming with confidence in front of their own fans and when Henry's deep cross found Mbeumo he had time to take a touch before curling a shot narrowly off target.
Then Ivan Toney, called up by England this week, was played in by a clever ball by Ben Mee but Daniel Amartey tracked his run and was able to deflect the shot wide.
However, from the corner, Amartey could only half clear Mbeumo's ball across the six-yard box and Jensen lashed it back into the net for his fourth goal in five home appearances.
Leicester complained about four Brentford players being in an offside position when the initial ball came in, but the goal was allowed to stand.
The Foxes drew level seven minutes after half-time when Barnes sprinted on to James Maddison's through ball, burst between Pinnock and Mee and coolly lifted his finish over Bees keeper David Raya.
Barnes gave Raya another scare when he charged through again, with the Spaniard coming out of his area only to fluff his clearance, but he was able to recover and clear the danger.
Brentford's afternoon ended on a sour note with substitute Shandon Baptiste sent off in stoppage time for a nasty lunge on Kiernan Dewsbury-Hall.