The three family members were found inside the third-floor apartment, according to police. They were investigating whether the fourth man, found dead from a fall, was the gunman.
Detectives suspect that the shootings were drug-related and that the gunman died trying to flee the scene, said police spokesman Paul Browne. Police recovered a semiautomatic handgun in the third-floor apartment in the rear of the walk-up building.
No arrests had been made.
The killings were reported at 1:45 p.m. at the building on Amsterdam Avenue near West 84th Street, a busy commercial strip in a tree-lined residential neighborhood a few blocks from Central Park and the American Museum of Natural History.
Two of the victims were found dead in a bedroom and one was in the apartment's bathroom, police said.
Darryl Gamble, who owns a women's clothing boutique on the ground floor, said he heard no commotion coming from the apartments.
"I think that most of the tenants have been there for years," Gamble said. He said he had no problems with his neighbors, outside of "the usual, New York noise, a few leaks."
Police had the entrance to the building and part of the block cordoned off. Scores of onlookers crowded the sidewalks, and dozens of police cars lined Amsterdam Avenue.
Associated Press writers Verena Dobnik and Virginia Byrne contributed to this report.