BOSTON—It is fitting that the Miami Heat’s chase of history brought them here, into a building that has, over the three years that Miami’s supergroup of LeBron James, Dwyane Wade and Chris Bosh has been together, been decidedly unkind.

The Heat entered Monday night’s game against the Celtics having lost 10 straight regular-season games at TD Garden, but they emerged with a 105-103 win. They broke the streak while, more important, also protecting their historic winning streak, which moves to 23 games and into second place in NBA history, 10 behind the 33 consecutive games won by the 1971-72 Los Angeles Lakers.

What is significant about the Heat winning No. 23 against the Celtics is that no team has been more crucial to the development of Miami as a potential dynasty over the last three years than Boston. It was only 2 1/2 years ago, remember, that the Celtics were sourly watching the Heat celebrate the signing of James, Bosh and Wade, irritated by the parade the Heat put on before the three ever played a game together. In the season opened of 2010, the Celtics delivered a body blow to Miami, winning in Boston, 88-80.

Looking at the Heat as they stand now they’re a lot like the Celtics were around the time they broke through for a championship in their first year together, 2008—only Miami’s core is much younger. The following year, the Celtics started 27-2 and had a 19-game winning streak, though the team was eventually undone by a knee injury to Kevin Garnett.

Still, Miami’s current phase of development can be compared to where the Celtics were back then. The Heat maintaining their streak as defending champs bears similarities to what that Boston team dealt with.

“They have pride,” Celtics coach Doc Rivers said. “They’re champions and they take that mantle and they want to prove it. We went through that. Listen, even though you, as a coach, are thinking, ‘Oh, man, this is exhausting, every night they’re attacking us, every team.’ The players are thinking, ‘Man, we’re the champs and we’re going to act like that.’ What they’re doing right now, they’re acting like they’re champs.”

If any team has taught them how to act like champs over the years, it has been the Celtics. That obviously has been the case in the playoffs, such as last year’s thrilling seven-game Eastern Conference finals in which the Celtics had Miami down, 3-2, before James took over Game 6 in Boston and the Heat finished off the series in Game 7. Had Miami lost either of those games and failed to earn a Finals trip, the whole Wade-James-Bosh experiment would have been declared a flop, and the Heat would have been labeled chokers.

In three seasons, the Heat have come far in that regard. That first year was a disaster late in games, but learning to beat smart, veteran, precise teams like Boston has caused the Heat to push their collective game forward to reach a different plane.

“It’s time and experience,” coach Erik Spoelstra said. “We have been through countless times. Sometimes you have to fail. Two years ago, we went through, it seemed like every late-game situation, we lost. Whether it was not playing or executing well, we just couldn’t get over the hump. That started to change last year. We’ve been in so many situations now, the guys feel very confident and very poised.”

They were in a tough situation on Monday on two different occasions.

First, Celtics forward Jeff Green, joining the starting five in place of the sick Garnett, had an astounding night, scoring a career-high 43 points and leading the Celtics to an early 41-24 lead in the second quarter. The Heat clawed back from that deficit, only to have the Celtics power their way back into the lead, taking a 13-point edge with 8:27 to go. But, powered by 13 points in the fourth quarter from James—including the decisive shot, an 18-foot pull-up with 10.5 seconds to go—the Heat were able to pull ahead of the Celtics just enough.

When Shane Battier blocked Green’s tying attempt in the lane and Paul Pierce missed an awkward 3-pointer in the corner with three seconds left, it sure looked like it was Miami that was the more poised, composed team, the team that executed better down the stretch.

That was once the Celtics’ advantage. But they have, apparently, given the Heat a very worthy example to follow.