In the middle of all the madness that was taking place at the TD Garden on Sunday night, Doc Rivers’ mind suddenly drifted to tonight.

Each and every key member of his Celtics was piling up minutes during a memorable triple-overtime game against the Denver Nuggets, and Rivers began thinking about the toll it would take with a game this evening in Charlotte against the Bobcats.

“I’m thinking … late in the game in the overtimes, ‘Boy, (tomorrow’s) going to be hard,’’’ said Rivers. “It’s funny how a coach thinks. I’m thinking, ‘We have to somehow win this game tonight.’’’

The Celtics did just that, surviving a thriller to get past the Nuggets, 118-114, in a game that gave people a break from thinking about the weekend blizzard.

In a matchup of teams that had the NBA’s longest current winning streaks, the Celtics extended theirs to seven while stopping the Nuggets at nine in a game that took just over three hours to play.

“This was back and forth, NBA’s finest at its best,’’ said Kevin Garnett after getting 20 points and 18 rebounds in 47 minutes.

Said Rivers: “It was a clear case of two teams that have been playing great. One had won nine, one had won six, and neither team wanted to lose the game.’’

The Celtics had not played a triple overtime game in the regular season since losing to the 76ers in Philadelphia on Jan. 13, 2006, 125-124. It was the first triple OT game at home since a win over the Toronto Raptors on Dec. 11, 1996.

The marathon came less than 24 hours after Notre Dame outlasted Louisville and Rick Pitino in five overtimes.

“Two more overtimes,’’ said Rivers, “and we could have caught Notre Dame and Louisville.’’

The Celtics (27-23) are four games above .500 for the first time this season and are 7-0 since Rajon Rondo’s season ended with a knee injury.

“A lot of people out there are questioning the level of our opponents,’’ said Jason Terry, who had 26 points. “The Lakers, not all the way right. The Clippers, weren’t healthy. This is a quality win for us.

“They had won nine in a row. They’re the hottest team in the Western Conference, a very tough matchup for us. Never underestimate the heart of a champion. We just kept fighting back.’’

Pierce does it again: For the second time in the seven-game winning streak, Paul Pierce had a triple-double, getting 27 points, 14 rebounds and 14 assists to tie a career high. Pierce is doing a little bit of everything in the absence of Rondo.

Page 2 of 2 - “He’s been unbelievable,’’ said Rivers. “He’s played himself on the all-star team, except people have voted already. That’s how good he’s playing for us. He’s doing everything.’’

Said Pierce: “Roles expand. I know what I’m capable of, but when you have a guy like Rondo, not as much is needed from me because you have another guy who can do so many things also. I think with him out, the roles change and I’m going to be more of a facilitator for this ball club.’’

Two to go: After meeting the Bobcats, who have the league’s worst record and have lost seven in a row, the Celtics host the Chicago Bulls on Wednesday before the All-Star break. … Jeff Green, who was feeling ill before the game, had 17 points and made some clutch shots in the overtimes. … The Celtics took 30 shots from 3-point range, hitting 13 with Terry going 5-for-14.