Mingdong Chen, 25, was charged with one count of first-degree murder and five counts of second-degree murder for the Saturday slayings inside a Brooklyn apartment where he had recently been staying with his cousin, his wife and the couple's four children, The Wall Street Journal reported.
The father was not at the apartment when the attack occurred.
Chen did not enter a plea and was remanded to prison.
Defense attorney Danielle Eaddy didn't request a psychiatric evaluation Monday, but could seek one later, the Journal said.
Prosecutors also charged Chen with multiple counts of assault after he allegedly attacked police officers while being questioned. The complaint said Chen allegedly punched and kicked one officer, and took another officer's glasses and threw them at her.
Chen "had "two good sized bruises that happened while he was in custody," Eaddy said.
Authorities said they hadn't determined a motive, but during his interrogation Chen allegedly indicated he was envious of his cousin's life in the United States, a source told the New York Daily News.
"He felt they had everything and that he had nothing. They were doing well and he was struggling just to get by," the police source said.
Killed in the attack were Qiao Zhen Li, 37, and children Linda Zhuo, 9, Amy Zhuo, 7, Kevin Zhuo, 5, and William Zhuo, 1. Li and Kevin were found alive in the kitchen but died at area hospitals. The other children were found dead in a bedroom.
Chen had been "bouncing around" and had only been staying with the family for eight to 10 days," NYPD Chief of Department Philip Banks said. He came to the United States in 2004 and his last known address was in Chicago.
A family friend told the New York Post Li had tried to evict Chen from her family's home.
The horror unfolded while the father, Yi Lin Zhou, 31, was out. The mother tried to call her husband to express fear about Chen's behavior but couldn't reach him, police said. She then called his mother in China, who called a daughter-in-law in Brooklyn, who went to the apartment with her husband.
"They bang on the door," Banks said. "At some point, he opens the door and they see that he is covered with blood."
Detectives captured Chen as he tried to escape, carrying the bloody knife, a source told the Post.
"If those detectives hadn't been in the area, he could have gotten away with it," the source said. "It's very hard to track a suspect with no criminal history. And this suspect was a drifter, a nomad. It would have been very hard."