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.
Nike Men's Arizona Wildcats Navy/Cardinal Team Issue Performance PoloShop
Alabama football's Nick Saban joins The Paul Finebaum Show to give his opinion about the social media platform and OC Lane Kiffin's recent tweets.
Alabama football coach Nick Saban joins The Paul Finebaum Show to discuss his hopes for the future of the game.
Kenny Potter, the MVP of the 2015 AutoNation Cure Bowl, tosses a football from the top of the stands into a trash can at Spartan Stadium.
Penn State's board of trustees has approved allowing some fans to buy alcohol at the university's football and basketball stadiums, as well as other athletic facilities.
Navigate Research explained that the Big 12's old model -- 12 teams, eight league games, a conference championship -- is best for maximizing the chance of reaching the CFP.
Satellite-camp season opens June 1 after the close of the spring evaluation period, during which time head coaches are not allowed on the road.