A very interesting idea. I've visited a number of ghost towns while travelling, mostly in the Southwest but also a few in the Northwest (Eastern Oregon is sooo deserted!), and Texas. These are my thoughts based on what I've seen in those places.
Offhand, it seems that your main problem would be access to water and food, since those things often go away with the population. With water being somewhat more likely to have around. Bowhunting might be a practical way to get food in some areas where there is not much plant life (Southwest deserts). If there are wardens living in or near the area, you can ask them what they do for food/water. Depending on the rapport with said wardens, you might be able to work out a deal where you chip in on their store runs.
But then again, you're not going to find much in the way of employment in a remote ghost town - perhaps farmhand work within the same county (in Texas this comes to mind)? You would have to really want to be 'off the grid & self sufficient', in my opinion, to live in such a place.
Ghost towns are often ghost towns for a very good reason - many of them were built by a specific company to house workers for a now-closed mine or quarry, and without the resources that the company provided in the past, humans would find it mighty hard to survive there. In other words, many of these settlements did not spring up 'organically' because it was a fine place to settle as pioneers, but they were put together lock stock and barrel as company towns. Still, squatting one would be a fabulous feat if you can pull it off!
Without outing the exact town you may have in mind, what geographical region is this question concerning? We can probably give better tailored advice, if we know the general lay of the land.