HOUSTON (AP) Jeremy Lin scored 31 points off the bench, Dwight Howard had 18 points and 24 rebounds, and the Houston Rockets beat the Toronto Raptors 110-104 in double-overtime to snap a two-game losing streak.
Lin shot 10 of 17 from the field and hit 8 of 9 from the free throw line. James Harden finished with 26 points and 10 assists.
Howard was just 4 of 12 at the foul line. Chandler Parsons had 18 points, five rebounds and five assists for the Rockets, who could not hold a double-digit, second-half lead for the second straight game.
Rudy Gay led the Raptors with 29 points and 10 rebounds but shot 11 of 37 from the field. DeMar DeRozan added 22 points, but he struggled as well, finishing 6 of 25.
Jonas Valanciunas chipped in 10 points and 13 rebounds, Amir Johnson had 10 points and 10 boards, and Kyle Lowry netted 16 for Toronto, who shot 33 percent from the field.
After Harden missed a jumper, Howard grabbed a rebound and gave it to Terrence Jones for a layup to give the Rockets a 106-104 lead with 1:13 to go in the second overtime. Gay missed a jumper, and Johnson missed the tip on the other end before Lin hit a floater with 33 seconds left to give the Rockets a four-point lead.
Gay missed another jumper, and after review, Houston was awarded the ball with 26 seconds left. Patrick Beverley made one of two free throws with 20 seconds left, and Gay missed a 3-pointer with 15 seconds remaining. Harden made one of two free throws to push the lead to six and ice the win.
Harden scored seven of the Rockets' first nine points in the second overtime, but Gay tied it at 104 with a 3-point play with 1:50 to go.
Gay tied the score at 95 in the first overtime, hitting a tough 3-pointer from the top of the top of the arc with 0.9 seconds remaining, and Lin missed a 3-pointer at the buzzer to send the game to a second extra period.
Trailing 80-66 after Lin's layup with 8:32 remaining in the fourth, Toronto knotted the score at 84 six minutes later on Terrence Ross's follow shot, capping an 18-4 run.
Harden made one of two free throws to tie it at 87 with 34 seconds remaining before Gay missed a jumper with 12 seconds left, but the referees called a 24-second violation, saying the ball never hit the rim.
After review, the ball hit the rim, and the officials jumped it up at midcourt, with the Rockets winning it, but Harden's jumper at the buzzer was short, sending the game to overtime.
NOTES: Toronto forward Steve Novak missed Monday's game with back spasms. . Houston guard/forward Francisco Garcia did not play in Monday's game as well with flu-like symptoms. . Harden was fined $5,000 Monday for violating the NBA's anti-flopping rules for a second time. Harden was cited for a fourth-quarter flop against the Los Angeles Clippers Saturday.