HOUSTON — When it was the Nets and Jeremy Lin against the powerful Rockets, the Nets were plus-17 points on the scoreboard. When Lin was on the bench, the Nets were minus-21.

The math didn’t quite add up for the Nets in a 122-118 loss to the Rockets Monday night at Toyota Center, but it was ample evidence of the impact Lin might make after returning from a 17-game absence because of a right hamstring strain.

Lin shook off the rust with 10 points on 4 of 8 shooting and had seven assists while playing 20:04. As center Brook Lopez said, “He fit in, and there was no rust. He was in at crunch time making big plays time and again. He had a great night.”

The fourth quarter was a microcosm of the game. Lin entered for the final 4:56 with the Nets trailing by six, and he led a 12-5 surge in which he scored four points as the Nets took a 114-113 lead. The game was tied twice more, but a series of Nets miscues in the final minute, including a Lin air ball from three-point range with the Nets down one with 18.9 seconds left, allowed the Rockets to close it out.

“I wanted to read the defense and take what he was going to give me,” Lin said. “I probably could have driven the ball, but I love that shot and I think I’m capable of hitting it . . . But for me and our whole team, we played aggressively, we played confident and we played to win. I’m OK with that.”

So was coach Kenny Atkinson, who was able to move a little closer to his ideal rotations even while bringing Lin off the bench. “It helps having Jeremy back,” Atkinson said. “It just organizes us. He had seven assists in 20 minutes. That’s big. He knows where to get Brook the ball and when to get it. I think we did a better job of driving the ball to the rim. We had a ton of points in the paint (a 68-36 advantage over the Rockets). There’s some real positives to take out of it offensively.”

advertisement | advertise on newsday

Lopez had just one rebound but led the Nets (6-17) with 26 points, Sean Kilpatrick added 17 and Trevor Booker contributed 10 points and 13 rebounds. But the Rockets (18-7) had James Harden to fill the stats line with 36 points, 11 assists and eight rebounds, and Eric Gordon came off the bench to add 24 points, including a 6-for-10 performance from three-point range.

Lin got into the game with 4:14 left in the first quarter after the Rockets had built an early 26-15 lead, and the Nets cut it to five on a Lin layup. And so it went each time Lin entered, including a six-minute span from the end of the third into the fourth when the Nets cut a nine-point deficit to 90-88.

“In terms of my wind, I felt fine,” Lin said. “I just struggled with the rhythm, the shots, the feel, making some reads, stuff that in a couple of games maybe it will all come back. You practice all these shots, but I got in there and it was like shooting a football. It will come back quick.”