"As much as I've been a rival with Boston over the years, I never want to see anyone go down," James said. "It's terrible."
James had a chance to put the Heat ahead after Pierce's 22-footer gave Boston a 99-98 lead with 31 seconds left in the second overtime. But James missed a 12-foot jumper with 6.8 seconds to go. Pierce got the rebound and was fouled.
He sank the first shot. Then, as a fan shouted "This one's for Rondo," he missed the second.
Miami had one last chance, but Shane Battier missed a long jumper at the buzzer.
"They defended that very well," Heat coach Erik Spoelstra said. "There are about three different options to it, four different options to it. They defended each one of them."
The Heat also could have won in the first overtime, but Dwyane Wade, who had 17 points, missed a jumper as the buzzer sounded.
Boston could have avoided the first overtime when Pierce inbounded from behind his backboard to Terry with 2 seconds left. But Terry's shot from the top of the key was short. The Heat had tied it on a 3-pointer by James with 7 seconds remaining in regulation after Ray Allen missed a 3-pointer with 15 seconds to go.
This game was Allen's first in Boston since he left the Celtics after five seasons and signed as a free agent with Miami. He scored 21 points.
The crowd gave him a standing ovation when highlights of his career were shown on the video board above center court during a timeout with 5:33 left in the first quarter. At the Miami bench, he raised his left hand in recognition.
"When I saw it, just all those emotions came streaming back from all the great things we did here," Allen said. "I'll always be a Celtic in my mind."
Allen entered the game about a minute after the tribute and was booed when he touched the ball. The boos came down again when he took two free throws — missing the first, making the second — three minutes into the second quarter.
Now the Celtics have neither member of their starting backcourt from the past five seasons, Allen and Rondo.
Rondo's injury "puts this team and the rest of the guys in a position to be ready to step up," Pierce said. Sunday's win "was a perfect example. We showed we are capable."
NOTES: It was Miami's first game in Boston since it won Game 6 of the Eastern Conference finals behind James' 45 points. ... James and Chris Bosh each had 16 rebounds for the Heat. ... The last time the Celtics played consecutive double-overtime games was on March 11 and 13, 1951.