It was James' most extensive action in three weeks as he was suffering from a sprained left ankle.
He also fed Kevin Love for a critical three-pointer with 46.3 second left to put the Cavs up 102-98.
Irving, who asked to be traded this summer after six seasons in Cleveland, had a chance to tie it with a 3-pointer at the horn but missed. Irving then shared a warm embrace with James, his teammate for three seasons.
Irving finished with 22 points for the Celtics, who overcame an 18-point deficit in the third and led with 2:04 left. Boston's guard was also called for a technical.
Hayward, who signed a four-year, 128 million dollars free agent contract with the Celtics this summer, was bumped by James while trying to catch an alley-oop pass with 6:45 left in the first quarter.
The forward's leg got twisted underneath him as he came back to the floor and snapped his ankle grotesquely.(ANI)