Foles threw two touchdown passes, NFL rushing champion LeSean McCoy had 131 yards rushing and a receiving touchdown and the Eagles beat the Cowboys, 24-22, in a win-or-go-home game for the NFC East title.
Dallas, with Kyle Orton filling in two days after Romo had back surgery, lost to a division rival with a playoff berth on the line for the third year in a row.
The Eagles will play host to New Orleans in a wild-card game Saturday night.
The Cowboys got another chance with a stop from the league's worst defense, but Orton's pass was intercepted by Brandon Boykin on the first play to seal the victory.
"We kept fighting. We believed in each other," said Foles, who was 17 of 26 for 263 yards after throwing for only 80 yards in the Eagles' 17-3 loss to Dallas at home. "When the offense was struggling, the defense picked us up."
McCoy finished with 1,607 yards and became the first Philadelphia running back to win the rushing title since Hall of Fame member Steve Van Buren in 1949.
"For all the accolades and the stats, if we didn't win today, none of that means nothing," McCoy said.
Orton was 30 of 46 for 358 yards with two touchdowns and two interceptions in his first start in two years.