Julius Randle scored 27 points and Elfrid Payton added 20 Wednesday night to help the visiting New York Knicks snap a two-game losing streak with a 107-103 victory over the Chicago Bulls.

The Knicks avenged Monday’s eight-point loss to the Bulls to earn a split of the back-to-back series by shooting 48.3 percent, including 50 percent from 3-point range.

New York outscored Chicago 62-50 in the paint. RJ Barrett had 17 points for the Knicks, while Mitchell Robinson snagged 11 rebounds.

Poor perimeter shooting plagued the Bulls, who shot 6-for-36 (16.7 percent) from long range, including just two makes from deep in the second half. Chicago entered the game shooting 38.6 percent from 3-point range this season, fifth best in the NBA.

Zach LaVine had 24 points and seven assists for Chicago, which has lost four of five. Thaddeus Young (19 points), Denzel Valentine (13), Coby White (13), and Patrick Williams (12) followed in double figures. Williams had a team-high seven rebounds as the Bulls were outrebounded on the night, 57-44.

A 20-5 run at the outset of the fourth quarter propelled the Bulls to within 99-96 with 5:45 remaining. New York regained control by scoring the next five points, as Chicago went scoreless for 3:11.

Randle was 11-for-20 from the floor while adding six rebounds and six assists. He has scored at least 15 points in 11 straight games and has finished with 25 or more points 12 times this season.

The Knicks led by as many as 19 points in the first half and took a 63-52 lead into the break, as Randle and Barrett combined for 29 points on 13-of-21 shooting. LaVine paced Chicago with 12 first-half points.

New York jumped to a 34-17 lead after one quarter, shooting 4-for-6 from long range compared to 0-for-8 for Chicago. Randle scored 11 points in the opening quarter while Payton had 10 points and seven rebounds. Payton entered the game averaging 11.3 points and 3.5 rebounds.

The Bulls have lost seven of 10 home games to start the season.