"It is a great feeling having the kid back," James said. "He does so much for our team."
Brandon Knight's 3-pointer cut Cleveland's lead to 96-95 with 1:27 to go and, after James missed a jumper, Knight hit another 3 but it was waved off because of an offensive foul against the Suns' Tyson Chandler.
The Cavs almost turned it over on their next possession but got the ball to Irving, who made a jumper from beyond the top of the key.
"J.R. Smith made an incredible winning play to save that ball," Cleveland coach David Blatt said. "That ball was going out of bounds and it looked like it would be their possession. He made a fabulous save. Kyrie made a huge shot."
Irving glanced at the clock and then coolly put the shot in the air.
"Those type of shots," he said, "it is just a calmness about it."
In his fourth game since returning from knee surgery, Irving also hit a 12-foot floater to put Cleveland ahead 96-92 with 1:44 to go.
Irving scored 22 points, Smith had 17 and Kevin Love added 16 for the Cavs, who ended a two-game skid. James had 14 points, only two on 0-for-3 shooting in the fourth quarter.
T.J. Warren scored 23 and Knight had 18 for the Suns, who earlier in the day announced they had fired assistant coaches Mike Longabardi and Jerry Sichting.
Nate Bjorkgren was promoted to take Longabardi's job as defensive coordinator. Assistant coach Earl Watson was promoted to a bench coach position.
Both teams were coming off their worst losses of the season. Cleveland was routed at Portland 105-76 on Saturday, the same night Phoenix lost an embarrassing one at home to Philadelphia 111-104.
In that defeat, the Suns lost leading scorer Eric Bledsoe to a torn meniscus in his left knee. The injury leaves Knight as the primary ball-handler for the next several weeks.
"We came out and fought the game all the way down to the last minute," Knight said, "so I think we put ourselves in a position to win or at least try to win. We've got to do a better job just correcting some things but I think the overall effort was better than it has been."
The Suns have lost 16 of their last 21, but at least this one provided reason for hope.
"It's still a loss," coach Jeff Hornacek said, "but it's encouraging that we're without Eric, we're out there a lot of time with Alex (Len) and Devin (Booker) and T.J., some of our young guys -- that's a good effort. You can't fault that."
The Cavs took the lead for good with 5 minutes remaining in the first half but never were up by more than 11.
The Suns were without forward Markieff Morris, who was serving the second of a two-game suspension for throwing a towel at Hornacek during a game against Denver last week.
Irving will sit out Tuesday night's game at Denver to rest as he works his way back from knee surgery. It will be the third time he skips the second of back-to-back games since his return Dec. 20. Irving said he expects that to be the final time he misses the second of games on consecutive nights. Cleveland doesn't have another back-to-back situation until mid-January.
Cavaliers: James passed Alex English for 17th place on the NBA's career scoring list and surpassed Stephon Marbury for 22nd in assists. ... Cleveland shot 62 percent in the first half, including 11 of 18 on 3s.
Suns: Bledsoe is scheduled to undergo surgery Tuesday and Hornacek speculated before the game that Bledsoe would be out six weeks. ... The Suns took eight more shots than Cleveland did. ... During a third-quarter timeout, fan Eric Kern won $5,000 for making a free throw, a 3-pointer and a halfcourt shot in under 24 seconds.
Cavaliers: At Denver on Tuesday night.
Suns: At San Antonio on Wednesday night.
Contenders, pretenders: Australia and New Zealand NBA preview
Basketball never stops, with the 2021-22 regular season set to tip-off on Wednesday morning live on ESPN, but before opening night Kane Pitman looks at the Australian and New Zealand players in the league.
Mikal Bridges' best plays from last season
Relive Mikal Bridges' top highlights from last season with the Suns.
Phoenix Suns, Mikal Bridges agree to four-year, $90 million rookie contract extension, agents say
Phoenix guard-forward Mikal Bridges on Sunday agreed to a four-year, $90 million rookie contract extension with the Western Conference champion Suns, his agents told ESPN's Adrian Wojnarowski.