Barber's one-yarder was his second touchdown of the contest, and capitalized on a critical fumble recovery by Cowboys nose tackle Jay Ratliff, who retrieved a loose ball on an errant exchange between Eagles quarterback Donovan McNabb and running back Brian Westbrook.
Dallas held firm defensively after that, halting the Eagles at midfield on 4th-and-17 to secure the win with 62 seconds left.
"We kept believing in each other," Cowboys head coach Wade Phillips said. "Everyone said, 'Hey, hang in there, we're going to come out on top' — and we did."
"We came so close," Eagles tight end L.J. Smith said. "We knew it would be a tough battle, but to lose like this hurts."
It represented the highest-scoring showdown between the longtime NFC rivals, one in which the lead changed hands seven times, and put the Cowboys up 53-42 in head-to-head meetings.
"It was one of the best games I have not only seen, but been a part of," Cowboys linebacker Bradie James said.
Quarterback Tony Romo, who likened the Cowboys to gunslingers, completed 21 of 30 pass attempts for 312 yards and three touchdowns with one interception.
"It is a good thing we were Clint Eastwood," he said.
Barber contributed 114 combined yards and two touchdowns, rushing 18 times for 63 yards and snaring four passes out of the backfield for 51 yards.
Placekicker Nick Folk provided field goals of 51 and 47 yards for the unbeaten Cowboys (2-0).
Terrell Owens also had a terrific night, hauling in two TD receptions to move into sole possession of second place on the NFL's all-time list with 132.
"We know that no game is going to be perfect," he said. "There is going to be interceptions, fumbles, missed assignments by everyone.
"But as a team, we came to play tonight. Offensively, defensively, I think everyone stepped up when they needed to."
Tight end Jason Witten led all receivers with seven catches worth 110 yards, matching the receiving yards amassed by Eagles rookie DeSean Jackson.
Witten later revealed that he played the second half with a separated shoulder that will be re-evaluated Tuesday.
"Little shoulder pops out and that is nothing," Owens said. "It just shows you how tough the guy is."
Cowboys safety Roy Williams, a five-time Pro Bowler, will likely miss the next three games with a fractured right forearm suffered on a special teams tackle.
McNabb finished 25-of-37 for 281 yards and one touchdown in a losing cause for the Eagles (1-1).
"These were two great teams going at it," he said. "There are a lot of positives we can take from this game.
"But that is not important right now. What we need to do is focus on the working on the negatives [because] that is going to make us a better team."
Westbrook had three touchdowns as well as 58 rushing yards and 45 receiving yards.
Davis Akers staked the Eagles to a 3-0 lead early in the first quarter with a 34-yard field goal, but Romo responded three minutes later with a career-high 72-yard TD strike to Owens, who caught the ball in full flight and outraced two defensive backs to the end zone.
It was the 131st TD catch for Owens, moving him past Cris Carter into second place on the all-time list behind Jerry Rice, who holds the NFL record of 197 TD receptions in 303 games.
"The Lord has, obviously, blessed me with a lot of talent," Owens said.
After Akers kicked a 44-yard field goal, rookie Felix Jones ran back the ensuing kickoff 98 yards for a touchdown - the first TD return for the Cowboys since Oct. 12, 2003.
Philadelphia trimmed the deficit on McNabb's six-yard TD toss to Westbrook and took the lead at 20-14 on the next play, when Romo fumbled the snap in the end zone and Eagles linebacker Chris Gocong pounced on the loose ball for a touchdown with 19 seconds gone in the second quarter.
Romo promptly made amends by driving the Cowboys downfield, capping an eight-play march with a four-yard TD toss to Owens at the 4:58 mark.
McNabb replied with a spectacular 61-yard heave — the ball travelled 51 yards in the air — to Jackson for an apparent touchdown.
However, Jackson committed a rookie mistake, flipping the ball backward as he broke into a celebratory dance.
The Cowboys issued a challenge and the touchdown was overturned on official review because the ball hadn't broken the plane of the goal-line.
Philadelphia retained possession of the ball and, on the next play from scrimmage, Westbrook scored on a one-yard TD plunge to make it 27-21.
Had McNabb's initial TD pass counted, he would have broken the franchise record of 175 held by Ron Jaworski.
Akers kicked a 22-yard field goal with 45 seconds left, but Romo combined with Witten for completions of three and 42 yards to put the Cowboys into range for Folk, who tucked a 51-yard field goal inside the left upright to cut it to 30-24 with three seconds remaining.
Dallas regained the lead with a nine-play, 79-yard scoring drive that concluded with Romo lofting a 17-yard TD pass to Barber 9:58 into in the third quarter.
Philadelphia went ahead 37-31 on Westbrook's third touchdown of the contest, a one-yarder on a second effort with 43 seconds elapsed into the fourth quarter.
Folk's 47-yard field goal sliced it to 37-34, and Ratliff later recovered the bungled snap between McNabb and Westbrook at the Dallas 33 to set the stage for Barber's winning touchdown.
'Boys Stun Eagles in Thriller
CowboysHQ Top Stories
Cowboys 1st and 10: The Front Four ShuffleEach weekend I provide 10 quick hits on the Cowboys. Marinelli is turning to his tackles to create an edge rush, the debate about Romo’s job security is a little insulting, and…
CowboysHQYesterday at 1:00 PM
Dallas Cowboys Fantasy Picks for Week 3Here are CowboysHQ.com's Dallas Cowboys Fantasy Football picks for Week 3 against the Chicago Bears (plus a Norm Hitzges special!)
CowboysHQFriday at 10:00 AM
Cowboys STARCast: 'Alpha Pup' Vs. The BearsCowboys STARCast: 'Alpha Pup' + 'Butterfly' + Big Changes On D Vs. The Bears - Hear from Tyrone, Jack, Church and Durant!
CowboysHQFriday at 7:05 AM
Cowboys Shuffle D-Line; Do Sacks Matter?We know the Cowboys' pass rush is challenged. We know, thanks to CHQ sources, that a shuffle is coming this Sunday. So, historically, how much do sacks really matter to a team's…
CowboysHQFriday at 4:57 AM