LeBron James commits his sixth foul after charging over Mickael Pietrus in overtime. (Charles Krupa/Associated Press)

The Boston Celtics have been counted out several times this season, this series included, and appeared to be low on energy and options in Game 4 against the hard-charging Miami Heat. They were dragging, gasping, barely holding on, and lost their best scorer to an offensive foul shortly after getting forced into overtime on Sunday night at TD Garden.

Paul Pierce shook his head and gave an uncomfortable smirk after a collision with Heat forward Shane Battier forced him to watch the final four minutes play out with him as a spectator. But as Pierce headed to the bench to sit, Rajon Rondo looked to Kevin Garnett and said, “It’s time. We have to take the game over.”

The takeover was hardly forceful, since Miami was also running low on fuel and later lost the league’s most valuable, LeBron James, to his sixth foul. But, as Pierce looked on, his teammates came through with just enough stingy defense and timely rebounding to survive his absence and scrap out a 93-91 victory at TD Garden.

“It was a cut, scratch, grab, hold, elbow type of game,” Pierce said after scoring a team-high 23 points. “A good, old, classic bar fight. Coming down to the wire, both teams trying to find an edge. This was a great game. I’d say it’s a classic.”

Rondo made a decisive floater in the lane with 2 minutes 32 seconds remaining and added another free throw late as Boston scored just 32 points after halftime but still managed to even the Eastern Conference finalsat two games.

James led all scorers with 29 points and forced the extra period with a three-pointer with 37 seconds left in the regulation, but he fouled out of a playoff game for the first time in his career with 1:51 left, leaving Dwyane Wade to miss an off-balanced, fallaway three-pointer as time expired.

“Red [Auerbach] wasn’t going to let that go in, you know that,” Celtics Coach Doc Rivers said. “Not in the Boston Garden.”

Rondo had 15 points and 15 assists and Garnett had 17 points, 14 rebounds and five blocked shots for the Celtics, who had six players score in double figures and built an 18-point lead in the first half. Reserve Mickael Pietrus didn’t score, and missed all three of his three-point attempts, but he had two huge offensive rebounds in overtime that allowed the Celtics to run down clock as they clung to a one-point lead late in the game. He also defended James as James picked up his sixth foul, appearing to wrap his arm around James’s waist and falling back.

“I don’t think I fouled him. I don’t think it was a foul,” James said. “I don’t foul out. If I’m going to foul out, that sixth foul, I wish I would’ve earned it and it had actually been a foul on me. Whatever.”

The series now shifts to Miami for Game 5 on Tuesday and the home court has proven to be the difference in the first four games. Both teams have won the first home game easily and needed overtime to claim the second.

“This series is probably the most unconventional as any series I’ve been a part of,” Heat Coach Erik Spoelstra said. “Both teams have had to go through a lot of adversity through this series. We’re reinventing ourselves daily.”

The Celtics used the energy of the home crowd to jump out to an early 21-6 lead, with Pierce and Rondo repeatedly driving inside and creating openings for Garnett to operate.

Rondo exposed every hole in the Heat’s defense in the first half, as he had 10 assists. His last two dishes were his sweetest. He tossed a beautiful lob to Garnett that Garnett guided into the basket as he got fouled. Then, Rondo found Pierce cutting and split James and Mario Chalmers with a bounce pass. Pierce got fouled on the layup and made the free throw to give the Celtics a 61-43 lead.

Early in the third quarter, Rondo sped up the floor, then slowed down to survey the court. When he noticed that most of the Heat players hadn’t made it back on defense, Rondo angrily ordered Pierce to cut to the basket, then flipped an underhand scoop pass to Pierce for an easy layup that put Boston up 16.

While leading his team, Rondo also played the role of instigator for the Heat, as he tracked down Wade on a fastbreak, bumped him and wrapped him up to thwart a layup attempt. Wade barked at Rondo, who walked away, but the exchange appeared to wake up Wade and the Heat, which closed the third period on a 19-8 run. Wade scored nine points during the run, including a three-pointer that brought Miami within 73-68 to the start the final period.

The Heat eventually took a 76-74 lead when rookie point guard Norris Cole made a driving layup, and the lead changed three more times. Garnett made a layup to give the Celtics ahead 89-86 with 52 seconds remaining, but James responded with a three-pointer, then coerced Garnett into fouling him on the other end.

On the final possession of regulation, Miami got the ball to James at the top of the key but the Celtics crowded him and forced him to get rid of the ball. James rushed a pass to a startled Udonis Haslem, who shot an air ball.

“Hopefully, we can execute a little better during a late-game situation like that next time we have the opportunity,” James said. “We’ve just got to come out with a sense of urgency. The last two games, we’ve come in and they’ve hit us hard. We’ve been down and it’s been an uphill battle. We understand what it takes to win, but no one said it was going to be easy.”

Haslem (12 points) had a driving dunk to start the overtime but the Heat didn’t score the rest of the game and the offense was out of sorts once James was forced to leave. Pierce felt like it evened the ledger. “It was very frustrating,” Pierce said, “but it’s very gratifying when you see the other star player fouling out also.”

Wade decided to go for the win, rather than the tie on the final shot. He pump-faked to get Celtics reserve Marquis Daniels to fly past him, then threw up a tough shot. “It was on line. It was all you can ask for,” Wade said. “I got my legs on the middle and shot it. It just decided it didn’t want to go in.”