Brooklyn Nets center Brook Lopez is defended by Chicago Bulls...

Brooklyn Nets center Brook Lopez is defended by Chicago Bulls center Robin Lopez in the first half of an NBA basketball game at Barclays Center on Saturday, April 8, 2017. Credit: Kathleen Malone-Van Dyke

The fans filled Barclays Center to the very top, a Saturday sellout crowd of 17,732 ready to watch the home finale of a rebuilding team that had been getting easier and easier on the eyes.

Then the Nets went out and showed again how much they’ve grown, especially the kids in the family.

The Bulls have been trying to nail down a playoff ticket. They owned a nine-point lead with the clock nearing four minutes left. But the Nets rallied to give the crowd a thrilling parting gift on Fan Appreciation Night — a 107-106 win.

Spencer Dinwiddie, who began the season in the D-League, scored 19, including seven in the final 1:23. Rookie Caris LeVert made two of his four threes to launch the comeback and also scored 19. And second-year pro Rondae Hollis-Jefferson contributed 16 points and 12 rebounds.

“I feel like a proud, I don’t want to say like a dad, but like a proud big brother or cousin or something,” Jeremy Lin said.

The Nets’ home tab came to just 13-28, but they won three straight and five of their last six here.

“I think the crowd has been outstanding, quite honestly, considering we haven’t had a ton of wins and not fighting for a playoff spot,” coach Kenny Atkinson said. “ . . . We understand that we’ll have to take another step next year. I think they should demand that.”

Their overall tab stands at 20-60. But the Nets have taken four of five and seven of 11. They’re 11-11 dating to March 1.

There are two games left for Brook Lopez to try to break Buck Williams’ Nets all-time scoring record of 10,440 points. After contributing 13 with Williams on hand, Lopez is 22 away from passing him.

“I do my best to ignore that stuff,” Lopez said. “I’m concerned about continuing our team’s growth.”

Chicago, which dropped to 39-41 and is in eighth in the East by a tiebreaker over Miami, grew a 97-88 lead. But LeVert drilled those two threes and Hollis-Jefferson converted a pair of drives in a 10-0 run, and the Nets were up 98-97 with 2:22 left.

Then Jimmy Butler came through with an 18-footer and two free throws, and the Nets were down 101-98.

Not a problem.

Dinwiddie nailed a three from the left side to tie it. Butler missed a 5-footer, and Hollis-Jefferson made two from the line for the lead.

But Butler hit a tough shot to tie it again with 31.7 seconds to go. Then Dinwiddie dribbled up top, drove and got fouled by Dwyane Wade, back after missing nine games with an elbow injury. Both free throws dropped through to make it 105-103 with 13.6 left.

“I think my confidence in terms of just playing at this level consistently, not having a short leash, being able to mistakes … has grown tremendously,” Dinwiddie said.

After a timeout, Butler missed a long jumper. Dinwiddie grabbed the rebound. Wade fouled Dinwiddie. And Dinwiddie hit to more from the line with 2.4 seconds remaining — 107-103. Butler swished a three at the buzzer to set the final margin.

“They’re a good team,” said Butler, who finished with 33 points. “They’ve been playing as well as anybody. I think our guys played incredibly hard.”

The Bulls took their first lead with 5:29 remaining in the third and led 82-75 after three. The Nets led by 15 in the first quarter and the second quarter before settling for a 51-45 advantage at the intermission.

“I hope we bring back a lot of guys,” Lin said. “I hope we make some moves, too. I don’t know what it’s going to look like [next season], but I think we’re trending in the right direction.”

More Brooklyn Nets

Newsday LogoSUBSCRIBEUnlimited Digital AccessOnly 25¢for 5 months