Barnes, who signed a new five-year deal with the Foxes in June, crashed home a brilliant winner six minutes after stepping off the bench.
It was tough on Chris Wilder's side, for whom substitute Oli McBurnie had headed a deserved equaliser after Jamie Vardy fired the Foxes ahead with his first goal of the campaign just before half-time.
The Blades gave another good account of themselves, roared on again by a partisan Bramall Lane crowd as they poured forward in search of a second equaliser.
But Leicester were the classier side and they held on for all three points after drawing their first two matches, while the Blades tasted defeat for the first time since winning promotion back to the Premier League.
The Blades started well, full of intent and well-organised, but Leicester's added composure gave them the edge and they looked more likely to break the deadlock.
But after Maddison's free-kick had struck the wall, all of United's good work was undone in an instant when defender Chris Basham was caught dithering on the halfway line.
He was dispossessed by Ayoze Perez and Maddison pounced on the loose ball to clip a beautifully-weighted pass through for Vardy, who took aim without breaking stride and lashed the ball home.
The double substitution gave the Blades a lift and, after a spell of concerted pressure, they struck a deserved equaliser when McBurnie climbed highest to head home Baldock's fine cross from the right.
But parity was short-lived. Christian Fuchs' ball into the area was half-cleared and Barnes, who had replaced recent signing Dennis Praet six minutes earlier, crashed home an unstoppable half-volley from the edge of the area.
Lundstram thought he had fired another Blades equaliser from Sharp's knockdown, but Schmeichel showed lightning reflexes to keep it out before the linesman flagged for offside.
Ravel Morrison made his Blades debut when he replaced Basham in the 78th minute and he had a late shot blocked as the home side laid siege to the visitors' goal.
But the mercurial former Manchester United forward had little time to influence the outcome.
United forced several late corners before Norwood's stoppage-time free-kick was deflected and the Foxes held firm.