Mr. Matos faces as many as 22 years in prison if he is convicted of assault charges at a trial, which has not yet been scheduled. His lawyers say he has never been charged with a violent crime before. He was arrested in 2015 for marijuana possession.

The district attorney’s office declined to name the students, but a law enforcement official identified them as Jorge Morales and Jose Bosch, who are from Guatemala and attend college in Boston.

The night of the stabbings, Mr. Morales was highly intoxicated, court papers indicated: He had a blood alcohol concentration of .30, almost four times the legal limit of .08 that is generally established for safe driving. He and Mr. Bosch were visiting New York and looking for a strip club and late-night pizza when the incident occurred, according to the documents.

In an interview with The New York Times, Mr. Morales said he was about to turn 21 and was out celebrating with friends. He said he remembered drinking beer and vodka and looking for pizza but could not recall searching for the strip club.

“I was pretty drunk, so I don’t remember some stuff,” said Mr. Morales, now 22. “Jose told me I kicked the box where he was sleeping, and that’s the reason he got mad.” Mr. Morales spent his birthday in the hospital.

Mr. Bosch did not respond to requests for comment.

Mr. Matos tells a different story. He said he had been surprised by what he thought was an assault near his head and had believed he was under threat. Standing shoeless, he grabbed a knife he used to cut twine and tape from the cardboard boxes, ready to protect himself.

He told investigators that the men returned and confronted him, with one of them bumping into him. “When he goes past me, he rubs his shoulder at my chest like, like, ‘You ain’t nothin’,’ and like, ‘Yes, so what?’” Mr. Matos told investigators.