TAKE THAT! Joakim Noah slams home two of his 12 points over the outstretched arm of Brook Lopez during the Nets’ 83-82 loss to the Bulls last night in Chicago. Photo: EPA

CHICAGO — The Nets looked like they had the game, and a third straight win, within their grasp.

But then Brook Lopez, who was facing restricted minutes in his second game back from a sprained right foot, left the game with 5:38 remaining and the Nets holding a 77-71 lead over the Bulls and in the midst of a 15-4 run.

From there, a combination of missed shots and turnovers allowed Chicago to go on a 12-2 run and hand the Nets an 83-82 loss in front of a sellout crowd of 21,866 inside United Center.

“I knew about it beforehand,” Lopez said after finishing the game with 18 points, 10 rebounds and two blocked shots. “It was definitely premeditated. I was all for it.”

In the end, it’s for the best, as the Nets (13-10) want to have Lopez healthy and on the floor for the rest of the season after the third injury to that right foot in the past 11 months caused him to miss the seven games before the Nets’ double-overtime win over the Pistons on Friday night.

That was why Lopez, who was expected to play around 24 minutes and in no longer than six-minute intervals, had to come out midway through the fourth despite the fact he and Joe Johnson had combined to score the first 15 points of the quarter for the Nets, who were playing extremely well at the time.

“We had to get him out,” coach Avery Johnson said. “He basically went over his minutes and give him a break. We were in constant communication and the staff had him on a 24-minute limit for the game, and also limiting him to six minutes at a time. We got it close to seven that one time, and we were a little concerned, [but] we should not have any problems going forward.

But, on this night, the fact Lopez was unable to keep going in the fourth was a major factor in them extending their winning streak.

After Lopez left the game, the Nets fell apart offensively, going 0-for-4 from the field and committing a pair of turnovers from the 5:38 mark, when Lopez left the game, until the 1:26 mark, when he checked back in.

“Had we done a better job of taking care of the ball, especially down the stretch, we could have come out on the winning end,” Avery Johnson said.

Then, after Lopez returned, their struggles continued. First, Joe Johnson lost the ball when he was trapped on the wing, allowing Luol Deng to streak ahead and slam the ball home to tie the game at 79.

“They started doubling whenever I got the ball,” Johnson said. “I knew they were going to trap me coming off a pick, but I tried to beat Joakim [Noah], and once I couldn’t, I didn’t see an outlet.”

Lopez then had a chance to give the Nets the lead on the ensuing possession, but his 12-foot baseline jumper came up short.

“It felt good,” he said. “It was just short.”

From there, the Bulls took the lead for good when Marco Belinelli took advantage of a miscommunication on a pick-and-roll coverage by the Nets and glided to the basket for a layup to give the Bulls a 81-79 lead.

“We never got organized, which is my fault,” Williams said. “Belinelli came off the pick-and-roll and just got an easy layup. He pretty much walked down the lane, which can’t really happen. It’s not what we wanted to see happen at a crucial point in the game.”

The Nets then had a chance to tie the game, but Williams’ 19-footer over Bulls rookie Marquis Teague also missed.

Belinelli then sunk a pair of free throws, meaning a buzzer-beating 3-pointer from Williams, who finished with 24 points and five assists, left the Nets one point short.

“We don’t want to take anything away from them,” Williams said, “but we feel like we lost this game with mistakes, defensive breakdowns and turnovers down the stretch.”