EAST RUTHERFORD, N.J. — The New Jersey Nets eliminated any chance of finishing with the worst record in NBA history by beating the Detroit Pistons 115-107 on Friday night.

Brook Lopez had a career-high 37 points and Yi Jianlian had a career-best 31 to lead the Nets to their ninth win. For the first time this season, the Nets have won two consecutive games.

Even if New Jersey (9-63) loses its final 10 games, it can do no worse than tie the league mark for the worst record (9-73), set by the Philadelphia 76ers in 1972-73. Hey, and that's not the worst.

Tayshaun Prince had 27 points for the Pistons, who lost their seventh in a row.

Detroit gave the Nets and their fans some anxious moments down the stretch, cutting a 12-point deficit with 2:47 to play to four points with 47.3 seconds to go. The Pistons then got the ball back on an 8-second violation.

With the tension high and many wondering whether the Nets would find a way to blow it, they came up with a big play, or the Pistons provided one.

Rodney Stuckey lost the ball on a baseline drive and Terrence Williams picked it up, was fouled and hit two free throws to push the lead back to 111-105 with 41.7 seconds to go.

Richard Hamilton, who had 18 points, then missed a long 3-pointer and Keyon Dooling made two free throws to ice the Nets first back-to-back wins since Apr. 11 and 13, games 80 and 81 of last season.

The Nets' point total and their 57.1 percent shooting from the field were season highs and it came in a game where they trailed by 13 points early in the first quarter.

Yi and Lopez were outstanding from the start. Lopez was 14-of-17 from the field and Yi was 12-of-16, hitting mostly jumpers. The two stepped up in the final quarter with Lopez scoring 12 of the Nets 38 points and Yi adding nine as New Jersey hit 10 of 15 shots from the field, including three 3-pointers.

Jarvis Hayes gave New Jersey the lead for good, hitting consecutive 3-pointers late in the third quarter to snap a 69-all tie. Yi added a 3-pointer late in the quarter to keep New Jersey ahead 80-77 entering the final 12 minutes.

After a basket by Stuckey closed the gap to a point, New Jersey went on a 12-4 spurt with Yi hitting three straight jumpers after Williams started the run with a 3-pointer and a dunk.

The Pistons hit 11 of their first 15 shots in jumping to a 23-10 lead with Prince scoring eight of his 12 first-quarter points in the run.

Yi helped the Nets get back into the game, scoring six points in a 14-4 spurt in the closing minutes of the quarter.

Pistons C Ben Wallace missed his third straight game with sore knees, while teammate Chris Wilcox was out with a hamstring injury. …New Jersey is now 5-32 at home. …The Pistons are 7-29 on the road. The Pistons won the season series 3-1.