Don't know about apartments, but for private property finding out if anyone died in said home is sometimes quite easy.
Know from helping someone with an interest in genealogy and old Staten Island cemeteries (many long abandoned and or forgotten), old burial records often list not only name, address, and cause of death but where that event took place.
Looking up homes on old streets one knew found more than a handful of instances where person died at home. Years were normally late 1800's through early 1900's (say until 1920's or 1930's, but some later).
What was interesting is though lot numbers obviously are same, original homes from back then are long gone as the property was redeveloped.
This is one of the sites used:
https://www.deathindexes.com/newyork/city.html