Halliday completed 39 of 53 passes for 319 yards and two scores, the junior's seventh 300-yard passing of the season.
On the final play of the game, from the Washington State 13, Denker's pass to Samajie Grant in the end zone was caught well out of bounds.
The Cougars (5-5, 3-4) had lost their previous three games by a combined score of 162-83.
Halliday's first touchdown pass, 23 yards to River Cracraft, came after Arizona's botched punt attempt at the start of the second half.
The Cougars' winning 80-yard drive came after Smith missed the 34-yarder with seven minutes to go.
On third and nine from the Washington State 38, Halliday threw 10 yards to Dom Williams. Halliday hit Teondray Caldwell for 19 yards to the Arizona 31. Then on third-and-four at the 25, Halliday threw to the wide open Myers, who dodged a tackler and ran a few steps to the end zone.
The Wildcats moved downfield and, on fourth and seven from the 28, Denker scrambled nine yards to the 19 for the first down. But Denker was caught at the 13 on third and six and Arizona, without any timeouts left, rushed to the line to get off a final play. Denker lofted it to the end zone and Grant hauled it in, but was a step out of bounds and the Cougars rushed the field in celebration.
The Wildcats spotted the Cougars a 10-0 lead, then got a pair of touchdowns from Carey -- one rushing, one receiving -- to lead 14-10 at the half.
Marcus Mason's 15-yard touchdown run put Washington State up 7-0, then Furney's 24-yard field goal made it 10-0 with 2:05 left in the first quarter.
Arizona struck quickly after the subsequent kickoff, Carey -- in his 13th consecutive 100-yard rushing game -- breaking a series of arm tackles on a 30-yard touchdown run to cut it to 10-7 with 47 seconds still left in the opening quarter.
The Wildcats took the lead with a 15-play, 90-yard touchdown drive. Denker threw wide to Carey, who broke two tackles on a 7-yard scoring play to put the Wildcats ahead 14-10 with 7:37 left in the half.
It was Carey's first touchdown catch of the season.
Arizona threatened again late in the half, but Smith's 40-yard field goal try was wide left as the second quarter ended.
The Wildcats took the second-half kickoff and went three-and-out, then Drew Riggleman dropped the ball trying to punt and Washington State recovered at the Arizona 31. On second-and-18, Halliday threw over the middle to Cracraft for a 23-yard touchdown and the Cougars were back on top 17-14.
The Wildcats moved down the field on their next possession, but their drive stalled at the WSU 8 and Smith's 25-yard field goal tied it at 17 with 6:36 left in the third quarter.
The Cougars, in their first game in 16 days, had a chance to take the lead with 10:24 left in the third quarter but Furney's 46-yard field goal attempt bounced off the left upright.
Arizona took over and moved it downfield but Smith's 34-yard field goal try was wide left.
The teams hadn't met since 2010 and Washington State hadn't played in Tucson since 2009.
Buffalo Bulls names Michigan's Maurice Linguist new head coach
Maurice Linguist, who served as Michigan's co-defensive coordinator last season, has been hired as Buffalo's head coach, the school announced Friday.
Arrest warrants filed for former Oklahoma football players Seth McGowan, Trejan Bridges
Arrest warranted were filed for Seth McGowan and Trejan Bridges on felony charges of robbery, conspiracy and assault and battery with a dangerous weapon.
Trask says Brady made him feel welcome with Bucs
Former Florida quarterback Kyle Trask joins The Paul Finebaum Show to discuss how it feels to play with Tom Brady and his lasting memories with Florida.
Alabama Crimson Tide's Nick Saban participates in new PSA encouraging COVID-19 vaccinations
Alabama Crimson Tide head coach Nick Saban is participating in a new public service announcement encouraging people to get vaccinated against COVID-19.
Grading college football's new coaching hires across the country
Which teams aced their selections, and which made more questionable picks? We break it down.
Everything you need to know about the NCAA's NIL debate
With the athletes, the NCAA, legislators and the courts all still involved, expect more twists and turns in the name, image and likeness debate. Check back here for all the latest news.