King, who was the Atlantic Coast Conference Player of the Year last season at Georgia Tech, was 21 of 34 for 180 yards and two touchdowns. He ran for 39 yards and the winning score.
"Well, that was a lot of fun. Just the back and forth of it. Just a really good game," Panthers coach Dave Canales said.
"The guys were resilient and finish is what we preach as a team. We practice for these situations, end of half, end of game. Haynes did a fantastic job, just keeping the play alive, doing whatever he had to do, run it, throw it. Really proud of the group."
Carson Beck also had an impressive debut for Arizona. After Beck left, Kedon Slovis tossed a one-yard TD pass to Bryson Green with 1:55 remaining to give the Cardinals a 30-27 lead.
But King rallied the Panthers on a night when both teams didn't play their starters. Bryce Young was King's biggest cheerleader on the sideline.
King's four-yard TD pass to Anthony Tyus III in the opening minute of the fourth quarter put Carolina ahead 24-20. King threw a 15-yard TD pass Ja'seem Reed in the second quarter. He had a 26-yard run on third-and-14 to keep the final drive going.
"These are things that he did throughout his career," Canales said of King. "The bottom line is move the chains."
Cardinals quarterback Jacoby Brissett and All-Pro tight end Trey McBride stopped by the Pro Football Hall of Fame Museum to see their jerseys displayed for breaking records last season.
McBride set an NFL record for receptions by a tight end in a season with 126. Brissett set a record for completions in a game with 47 against San Francisco last November.