A 42-year-old man was stabbed and wounded in a clash near Times Square early Wednesday, police said.

The victim got into a dispute with his attacker on W. 42nd St. near Ninth Ave. in Hell’s Kitchen about 2:30 a.m., cops said.

During the fight, his adversary pulled a knife and plunged it into the victim’s chest.

Medics rushed the victim to Bellevue Hospital, where he’s expected to recover.

His attacker was last seen running east on W. 42nd St. toward the Port Authority Bus Terminal and has not been caught. He was wearing a white T-shirt and dark-colored pants.

Cops were scouring the area for surveillance footage that could help them track the suspect down.

The 2:30 a.m. attack was just three blocks from where a self-proclaimed “wanderer” passing through the city was stabbed to death in a random attack inspired by a sick social media trend last month.

On May 4, a 17-year-old boy knifed Leonidas Baez to death outside Burger & Lobster, a restaurant on W. 43rd St. near Seventh Ave.

When he was arrested on murder charges, the teen told cops he was following a “mess-with-a-crackhead” TikTok trend when he antagonized the sleeping stranger, according to police sources.

Baez’s sister described her brother as a free spirit who wandered up and down the East Coast, from Florida to his home state of Massachusetts, where his two children live with their mother.