In my opinion, gentrification can happen in various ways. It can happen due to a cultural shift, market shifts or it can happen from a policy shift. Take three sydney suburbs which have experienced gentrification as examples:
1. Surry hills- (cultural shift) - used to be lower socio economic composition, lots of social problems- drugs poverty etc but has since become popular with the homosexual, hipster, artistic subcultures.
2. Millers point - (policy shift) - used to be and still has pockets of transient homes, department of housing etc but now slowly lot by lot is being sold off. Even before the sell off the surrounding area has always been premium due to proximity to water. This is also a cultural shift, 100 years ago, people didn't like living near water, water was only for industry due to logistical reasons by shipping.
3. Pyrmont/ultimo - (market+policy shift) - historically, this area was industry, wool stores, refineries etc, they were near the water because these industries needed to ship their goods. Through technological change, shipping was no longer the preferred method of transport and it was cheaper to move these industries elsewhere, these wool stores and other industries became obsolete. The government policy makers identified this and rezoned the entire area for high density development.
Having said that, infrastructure can also gentrify an area, uni, motorways, hospitals etc
To answer the original question, i don't think high density has anything to do with it. Areas don;t become higher density for no reason. They were identified by governments as areas to concentrate densities. You need to identify why these areas were chosen to have higher densities in the first place