Cowboys came into the clash with their rivals on the back of five straight defeats which had left them rooted to the bottom of the division, but they made the first significant play of the game when Matt Cassel found Dez Bryant for a 51-yard catch and run to get into the red zone.
Shortly afterwards they recorded the first score when a drive of 11 plays saw Cassel go down the field for 93 yards after a fourth-down conversion kept the drive alive, and he found Cole Beasley to dart over and put the Texas side in front.
Eagles struggled in the first quarter, throwing beyond the sticks only once from their four third downs, but they gradually began to up the tempo and they replied early in the second when DeMarco Murray capped a 13-play drive with a one-yard touchdown against his former club to tie the game.
Philadelphia took the lead for the first time when they went 95 yards on seven plays and Ryan Mathews punched in for six after a huge catch and run from Matthews, but after Cowboys were lucky to recover a fumble from Brandon Graham's second sack of the night they hauled themselves level once more with time running out in the third quarter as Cassel and Beasley linked up again.
A huge play early in the final quarter saw Eagles retake the lead when Jordan Hicks scored from a 67-yard interception return, but this time the advantage lasted just a minute of play.
Whitehead sent a 79-yard kickoff return to set up Dallas at the 24, and they capitalised on the play and a poor defensive line from Philadelphia as Dez Bryant outjumped a host of players to catch Cassel's 18-yarder and tie things up again.
The game continued in nip-and-tuck fashion right to the end as the sides twice exchanged field goals, with Dan Bailey slotting his second effort in via the upright with just 27 seconds remaining after a controversial interference call to take the game into overtime.
After a fumble call on the field was overturned for a first down for Eagles, Sam Bradford found Matthews from 41 yards to win it and condemn Cowboys to six successive defeats for the first time in 14 years.