LeBron James Seethes, and Nets Are Hotter, Winning 5th in Row Miami's LeBron James drew a flagrant foul on Mirza Teletovic. Angered, James was restrained by his teammates. He later fouled out. Al Bello/Getty Images LeBron James spent much of Friday night fuming. Almost as soon as he stepped on the court, he was jawing at the referees, shooting them incredulous glares. He slammed the ball to the floor early in the fourth quarter when his teammate Michael Beasley committed an offensive foul. He told a heckler along the baseline to sit down. But after four quarters of impassioned play and a tense overtime period, James could only sit on the Miami bench with a faraway stare as the Nets outlasted the Heat to notch a rousing 104-95 win in double overtime at Barclays Center. The suddenly surging Nets (15-21) stretched their winning streak to five games as an angered James could only take his team so far. He led a fourth-quarter comeback to erase a double-digit deficit. But he barreled into Shaun Livingston with 36 seconds left in the first overtime and was called for a charge - his sixth foul of the game. He finished with 36 points, 7 rebounds and 5 assists, and still the Nets could feel as if they did their job. Paul Pierce scored 23 points Friday. The Nets" offense has looked more fluid since he began starting at power forward. "Switches, trying to get up into him, making him feel uncomfortable," Shaun Livingston said about the Nets" efforts to unnerve James. Those guys, if they start feeling good, teams are in for a long night. James boiled over with 8 minutes 37 seconds left in regulation, when Mirza Teletovic wrapped him in a two-handed headlock on a drive to the basket - a flagrant foul 1. James jumped into Teletovic's face and needed to be restrained by his teammates. "He went around the neck; it's not a basketball play," said James, who also accused Andrei Kirilenko of flopping on a number of occasions. James made the two ensuing free throws to cut the Nets" lead to 3 points. He scored 13 points in the fourth quarter - 9 after Teletovic's foul - and tied the game at 89-89 when he made one of two free throws with 40.8 seconds remaining. Paul Pierce put up a step-back 3-pointer at the buzzer, but it rattled out of the basket, sending the game into overtime. Norris Cole then forced a second overtime when he dribbled the length of the court and, with 3.3 seconds on the clock, sank a pull-up jumper from the top of the key to tie the game at 93-93. Pierce missed another fall-away jumper at the buzzer. But the second overtime - without James - proved anticlimactic as the Heat managed just 2 points in the period. James was asked how it felt to have to sit and watch his team unravel. "It was great," he said sarcastically. You should know the answer. The Nets" spirits, meanwhile, were soaring. They had prevailed over the Heat, 101-100, way back on Nov. 2, their home opener. Before the game, they marveled at how long ago that first game seemed. The team's look and feel have changed so much since then; it has experienced so much adversity. So even though it is early - not even halfway through the N.B.A. season - the Nets" second win over the Heat, the defending champions, should give them some confidence. "It's very high at this point," said Joe Johnson, who led the Nets with 32 points, "and that's where we want to keep it." The Nets did many things right. They outrebounded the Heat, 49-39. They had 17 second-chance points compared with the Heat's 2. Pierce finished with 23 points. Livingston played more than 51 minutes and finished with 19 points and 11 assists. Since 2014 began, the Nets have looked like a wholly changed team. Often running smaller lineups - starting with Pierce at power forward and Kevin Garnett at center - the offense has taken on a new fluidity. Their defense has become swarming and suddenly impenetrable. Erik Spoelstra, the Heat's coach, said he was not surprised. "When they were going through their struggles last month, everyone was ready to make strong conclusions about them or anybody in the Eastern Conference, and I just kind of rolled my eyes," Spoelstra said. It was way too early, way too premature. They have a lot of talent. The night, all around, had an altered feel. For one thing, both teams wore jerseys with players" nicknames on the back. The back of Garnett's jersey read Big Ticket. James wore King James. Kirilenko went with the Cyrillic spelling of his name. (Some players could not use their first choice nicknames. He went with Plums instead.) And Barclays Center, lukewarm so many nights, was pulsating with energy from the start. Pregame pyrotechnics left a thick haze hanging over the court, and Johnson and James provided some early heat from the floor. Johnson made eight shots before finally missing one. James finished the first quarter with 16 points, on 5-for-6 shooting. But he went scoreless in the second, and even he admitted his attitude dipped. "I apologized to my teammates at halftime," James said. I told them that my frustration and my body language was all wrong. Miami was missing three regular starters. Dwyane Wade, who played 39 minutes during a loss to the Knicks on Thursday night, was ruled out with left knee soreness. Mario Chalmers (Achilles" tendinitis) and Shane Battier (sore quadriceps) were also unavailable for the Heat. The onus to produce a win was all on James. And he almost did, before the Nets got under his skin once and for all. Deron Williams (sprained left ankle) sat out Friday night and was not expected to play Saturday night. An earlier version of this article misstated Joe Johnson's point total. He had 32 points, not 36.