PHILADELPHIA — Amar’e Stoudemire scored 21 points and Carmelo Anthony added 18 to lead the Knicks to a 102-92 victory over the Philadelphia 76ers last night.

J.R. Smith returned from a one-game benching for unsportsmanlike conduct and contributed 11 points for the Knicks (14-22), who have won four straight. Anthony added nine rebounds and seven assists. Stoudemire went 8 for 10 from the field.

Spencer Hawes and James Anderson each had 17 points to lead the Sixers (12-25). Thaddeus Young chipped in 15 points for Philadelphia, losers of four in a row.

After outscoring the Sixers 32-12 in the second quarter to take a 52-40 halftime lead, the Knicks came out strong after the break. They scored the first four points to open their biggest lead to that point — 10:56 left in the third quarter.

The Sixers never got closer than 10 the rest of the way.

After dropping 13 of 16 to start the season, the Knicks have turned things around. Defense has been a big reason for their success of late. New York has given up just 87.3 points per game and limited opponents to 29.3 percent 3-point shooting during the winning streak that includes Thursday’s 102-92 home victory over defending champion Miami.

The Sixers, meanwhile, entered last in the league in scoring defense (111.2 points per game) and have been even worse lately, allowing 113.3 points during their losing skid that followed a four-game road winning streak.

New York got a big boost from Smith in the second quarter that began with the Knicks down 28-20.

Knicks coach Mike Woodson benched Smith for the entire first quarter before inserting him at the start of the second. The reigning Sixth Man of the Year was benched on Thursday and was fined $50,000 by the league for unsportsmanlike conduct after untying or attempting to untie the shoelaces of opponents in two straight games.

Smith nearly eclipsed his season average of 11.3 points per game entering yesterday in the second quarter alone, scoring 11 points by making all four of his field goals, including a pair of 3-pointers, to go with four assists and two rebounds.

The shoelace incident was the latest in a series of transgressions this season for Smith, who was fined $25,000 in November for sending a threatening Tweet to the Pistons’ Brandon Jennings. That followed a five-game suspension without pay to start the season due to a violation of the league’s anti-drug policy in the offseason.

Notes: Kenyon Martin was charged with a Flagrant 1 foul with 8:53 left in the third quarter for elbowing Young. … Tyson Chandler (illness) missed his third straight game for the Knicks. New York also was without backup point guard Beno Udrih (knee). … Lavoy Allen (calf) missed his second straight game for Philadelphia. … Knicks baskets received the loudest cheers as there was a large contingent of visiting fans among the 16,278 at the Wells Fargo Center. … Rapper Meek Mill, a Philadelphia native, was seated courtside.