The size comparison is a bit off; Manhattan is about half the size of SF (https://www.comparea.org/r2552485+r111968). Of course, NYC is over 6x the size of SF (https://www.comparea.org/r175905+r111968).
Which generally checks out in numbers. Brooklyn's density is ~14,700/km^2, SF's is ~18,500/km^2.
By comparison, Manhattan is 27,800/km^2.
Same units, Brooklyn is ~35,300/m^2, SF ~18,500/m^2
Manhattan ~69,400/m^2
all from https://en.wikipedia.org/wiki/List_of_United_States_cities_b...
Edit: bonus round! I got Manhattan right but did the reverse error for SF (quoting km^2 for miles^2).
Still, NYC subway is far denser both within Manhattan as well as the surrounding area.