By JOHN JACKSON| December 19, 2018 at 11:13 PM EST - Updated December 20 at 5:14 PM

CHICAGO (AP) — A few weeks ago, the Brooklyn Nets were mired in an extended losing streak mainly because of shortcomings on the defensive end late in games.

On this night, they showed just how much they've progressed in that area.

Spencer Dinwiddie scored 27 points off the bench and made a critical defensive play in the final seconds, lifting the Nets over the Chicago Bulls 96-93 Wednesday for their seventh consecutive victory.

Jarrett Allen had 16 points and 12 rebounds for the resurgent Nets (15-18), who had dropped eight straight before putting together the NBA's longest active winning streak.

"One of the things that was causing us to lose those games is that we weren't getting enough stops," Dinwiddie said. "To win a game when we both scored in the 90s is big-time for a young group and shows our constant improvements."

Brooklyn's effort was even more impressive considering it came on the second night of a back-to-back, following an emotional 115-110 victory at home Tuesday over LeBron James and the Los Angeles Lakers.

"After last night's win it could be easy to rest on your laurels, and road back-to-backs have been tough for us," Nets coach Kenny Atkinson said. "If you want to rank the wins, I put this one first and last night's second."

Kris Dunn scored 24 points for Chicago, which has the worst record in the league at 7-25 after dropping 12 of its last 14. Bobby Portis added 16 points and 11 rebounds for the Bulls before exiting in the final minute with an apparent left ankle sprain.

"I like the fact that we hung in there," coach Jim Boylen said. "I thought we were in mud a little bit at times and a little stagnant."

Brooklyn Nets center Jarrett Allen, left, celebrates with forward Rondae Hollis-Jefferson after scoring a basket against the Chicago Bulls during the first half of an NBA basketball game Wednesday, Dec. 19, 2018, in Chicago. (AP Photo/Nam Y. Huh) (AP)

Chicago led 93-92 before Joe Harris put Brooklyn ahead to stay on a floating bank shot — after pump-faking on a 3-pointer — with 43 seconds left.

But the key to the win was the Nets' defense on the last two possessions. First, they forced Lauri Markkanen into an offensive foul. Following a Brooklyn turnover, Dinwiddie then deflected a handoff to Dunn at the top of the key and Harris gathered the loose ball with 2.3 seconds to go.

"Kris Dunn had been very aggressive for them all night, so I figured it was a best bet to deny him versus letting him catch and just trying to get one last stop," Dinwiddie said. "Fortunately enough, (Justin) Holiday put the ball out a little bit and I was able to kind of knock it away."

Dinwiddie was fouled with 1.4 seconds left and made both free throws for a three-point margin. Chicago, which was out of timeouts and couldn't advance the ball, never got a shot off that could have tied the game.

The score was tied at 71 entering the fourth quarter. The Bulls picked up their defensive intensity early in the period — including some full-court pressure — to force Brooklyn into a few sloppy turnovers. The result was an 86-80 Chicago lead midway through the quarter, but the Nets answered with seven straight points to regain the lead.

TIP-INS

Brooklyn Nets head coach Kenny Atkinson reacts to a call against the Chicago Bulls during the first half of an NBA basketball game Wednesday, Dec. 19, 2018, in Chicago. (AP Photo/Nam Y. Huh) (AP)

Nets: F Rondae Hollis-Jefferson (bruised left quad) was a game-time decision. He finished with nine points in 28 minutes.

Bulls: F Jabari Parker sat out a second straight game because of a stomach illness. Parker entered third on the team in scoring at 15.2 points per game, but he was taken out of the regular rotation last week. ... C Robin Lopez was fined $25,000 and Dunn $15,000 by the NBA for their role in an altercation during Monday's 121-96 loss at Oklahoma City. Raymond Felton and Dennis Schroder of the Thunder were each suspended one game for leaving the bench area during the scuffle.

Bulls G Zach LaVine will miss two to four weeks with a sprained left ankle. LaVine leads the team in scoring with an average of 23.8 points. He also leads in assists (4.8) and is averaging 4.9 rebounds. He was injured late in a 97-91 loss to Orlando last Thursday in Mexico City. LaVine had an MRI in San Antonio on Saturday and was re-evaluated this week when the team returned to Chicago. "The good news, I guess, is it's just an ankle sprain," he said.