Arizona (2-0) fell into a quick 14-0 hole before scoring the next 30 points as Oklahoma State (1-1) unraveled under a shower of yellow flags. The Cowboys had 15 penalties for a school-record 167 yards before settling down enough to rally within two points late in the third quarter.
The Wildcats wouldn't let them any closer behind Carey, who ran for 126 yards and scored on two touchdown runs in the fourth quarter to seal an impressive second win under new coach Rich Rodriguez.
Oklahoma State's Wes Lunt threw for 436 yards and four touchdowns to Tracy Moore, but also had three interceptions, including one returned 48 yards for a touchdown by Jonathan McKnight in the fourth quarter.
Carey ran for 147 yards in his debut as the featured back last week and followed it up by scoring on two 1-yard runs, another from 25 yards and on a 13-yard screen pass. Scott finished 28 of 41 and ran for 55 yards with another score.
Oklahoma State opened its first season without stars Brandon Weeden and Justin Blackmon with an absurdly easy 84-0 win over Savannah State.
Arizona had a much tougher start in its first game under Rodriguez, needing overtime to pull out a victory over Toledo at home.
That set up a showdown in the desert between familiar foes.
Oklahoma State had beaten Arizona the previous two seasons, in the 2010 Alamo Bowl and in Stillwater last year, by getting off to a fast start, outscoring the Wildcats by a combined score of 44-7 in the first half.
It looked like a repeat on the way after Lunt marched the Cowboys through Arizona's defense the first two drives, hitting Moore on touchdown passes of 9 and 30 yards to put Oklahoma State up 14-0.
The game turned quickly when the Cowboys turned ugly.
Defensive tackle Calvin Barnett was called for consecutive personal fouls on one play, setting up Scott's 15-yard touchdown pass to Richard Morrison.
A fumble by Joseph Randle on the next drive, followed by a late-hit penalty on cornerback Broderick Brown, set up a 22-yard field goal by John Bonano.
A fourth personal foul by Oklahoma State in the half, on linebacker Shaun Lewis for hitting Scott as he slid, led to a third field goal by Bonano, a 24-yarder. Carey added a 1-yard touchdown run - with a little help from teammates - late in the quarter to put Arizona up 23-14 at halftime.
Oklahoma State had nine penalties for 110 yards in the half and its last drive ended when Arizona's Jared Tevis intercepted a tipped pass by Lunt at the Wildcats' 29.
The second half opened the same way: Barnett was flagged for a late hit on the opening play and Arizona scored on a 13-yard screen pass from Scott to Carey for a 30-14 lead.
But the score seemed to snap the Cowboys out of their funk.
Lunt hit Morgan for a 9-yard touchdown pass and the Cowboys kept marching on Arizona the next drive, setting up Jeremy Smith's 10-yard touchdown run that cut Arizona's lead to 30-28.
It turned out to be their last gasp.
The Wildcats raced down the field on their next drive, setting up Scott's 8-yard touchdown run up the middle. Lunt, facing pressure for one of the few times all game, threw up a weak pass early in the fourth quarter and McKnight picked it off for an easy touchdown. Oklahoma State was called for pass interference on the 2-point try - naturally - and Arizona converted on the second attempt to go up 45-31.
Carey sealed it with a 25-yard run up the middle, sending the Zona Zoo into a frenzy and the Wildcats to an impressive win that will surely turn more attention toward the desert.