Barnes was first to meet Jon Stead's cross and powered in an unstoppable header past Leeds goalkeeper Graham Stack and into the corner of the net.
Leeds' Hayden Foxe tested Stephen Bywater from 20 yards with a dipping drive and Robbie Blake also went close.
Derby manager Billy Davies:
"Giles Barnes has got good potential but he can get better like a lot of our players.
"His final ball should be better. His left side should be better. He's got great potential but he's a young player and he can't rest on his laurels. None of us can. We're not good enough to do that.
"I thought our opening 45 minutes was exceptional. The game should have been dead and buried, but we've got to be very proud in the end. It's our first result here for 32 years."
Leeds: Stack, Crainey, Ehiogu, Heath, Foxe, Blake, Derry, Douglas, Lewis (Carole 90), Kandol, Healy (Moore 67).
Subs Not Used: Warner, Richardson, Howson.
Booked: Foxe, Douglas, Derry.
Derby: Bywater, Edworthy, Moore, Leacock, Boertien, Jones, Seth Johnson (Bisgaard 69), Oakley, Barnes (Michael Johnson 85), Howard, Stead (Lupoli 90).
Subs Not Used: Grant, Peschisolido.
Booked: Leacock, Howard, Oakley.
Goals: Barnes 9.
Att: 20,087
Ref: S Tanner (Somerset).