The anticipation of Linsanity overshadowed the Rajon Rondo trade intrigue for a few hours Sunday, allowing Rondo to enter the Celtics’ showdown with the New York Knicks as the other guy. While he relishes his privacy, Rondo is motivated by perceived slights, and he probably spent the past few days wondering if anyone believed Jeremy Lin was the best point guard on the floor.

Rondo then went out and gave a stellar performance that thrilled the TD Garden crowd. He controlled the pace, seemingly chased down every loose rebound, and passed to a fault in collecting his 17th career triple-double and second in three games.

His 18 points, 17 rebounds, and 20 assists catapulted the Celtics on a third-quarter run and lifted them in overtime in an emotional 115-111 win over the Knicks. It was Boston’s fourth straight triumph.

Rondo’s energy and execution in the first three quarters pushed the Celtics to a double-digit lead, but the Knicks came back. It was Paul Pierce’s improbable, leaning, contested 3-pointer with 4.9 seconds left that tied the game at 103 and forced overtime.

Lin had sparked a late charge with 6 straight points, including a 3-pointer with 2:07 left in regulation, that reduced the Celtics’ lead to 96-95. Carmelo Anthony, angered by a hard foul from Mickael Pietrus in the third quarter, then added New York’s next 6 points for a 101-100 lead with 35.4 seconds left.

Pierce attempted to counter, but the defense pushed him near the 3-point line and he launched a fadeaway 22-footer that missed. But after two Steve Novak free throws, Pierce atoned for that miss, scoring 3 of his game-high 34 points on the clutch trey.

“I got to a spot where I like to get the shot off from, maybe rushed it a little bit, but it felt good coming off my hand and sometimes they go in and sometimes they don’t,’’ Pierce said of the missed shot. “But I had another opportunity, another crack at it, and I always say if at first you don’t succeed try again.

“You know what it is, you’ve got an Atlantic rivalry, it’s not only been this season, it’s been since they traded for Amar’e [Stoudemire] and Carmelo and they became relevant again. It’s just something about that New York-Boston rivalry.’’

Rondo took control in the extra period, scoring 5 points with 5 rebounds and 2 assists.

Since a report Wednesday stated the Celtics were looking to deal Rondo because of his attitude and decaying relationship with coach Doc Rivers, the 26-year-old guard has averaged 15.6 points, 10.3 rebounds, and 14.3 assists. And he collected more rebounds yesterday than Tyson Chandler (14) and Stoudemire (13).

“I’m just playing,’’ Rondo said. “The biggest thing is we got the win. You know, P made that shot to send us into overtime, and that was big for us. If you get those type of numbers and you lose, it’s kind of irrelevant.’’

Rivers said he had no idea of Rondo’s totals until he was shown a final stat sheet.

“I kind of glanced over the bottom numbers, I didn’t know, 20 assists?’’ he said. “The big number is 20 assists and four turnovers. That’s nice.’’

The Celtics needed all of Rondo’s contributions against a Knicks team that had been revitalized since Lin’s meteoric rise the past three weeks. The former Harvard standout finished with 14 points, 4 rebounds, 5 assists, and 6 turnovers in a foul-shortened 32 minutes.

Baron Davis came off the bench for Lin and fueled a run that helped the Knicks climb back into the game after they trailed, 80-65, late in the third quarter. Lin reentered at the 7:16 mark of the fourth with the Celtics leading, 88-82. He scored 6 points in that period and resembled the Lin who had put up gaudy numbers.

Yet in OT, Lin missed six of seven shots and Anthony missed all four attempts as the Knicks went 3 of 16.

“They did a good job controlling the paint, for sure,’’ Lin said. “They sent a lot of bodies and they had me take a lot of tough shots. I didn’t get a lot of easy stuff. But, still, in my opinion, I should have finished a lot of those shots. So, hopefully next time we play them I’ll be able to hit the same shots.’’

After Stoudemire scored the first basket of OT, the Celtics went on a 7-0 run with Ray Allen draining a 3-pointer off the fast break and then receiving a Rondo pass for an easy layup.

The Knicks would not get closer than 3 points.

“I thought going into it [it was an important game],’’ Rivers said. “This is a team trying to move in front of you, playoff position. You just never know. The biggest thing is, [the Knicks] are getting confidence, and we didn’t want that to grow against us. They haven’t had it, ever. And now they’re getting it, and I thought it was very important for us to win this game.’’