Urban crime poses a serious challenge to urban sustainability and livability. Many studies have been conducted to explore the patterns and causes of urban crime, as well as prevention techniques. Studies have found that neighborhood socioeconomic status affects the incidence of urban crime, but studies on this topic are limited due to data limitations. To fill this gap, this study designed an approach for Brooklyn, USA, that collects publicly available data from housing advertising sites and the Open Street Map and trains a machine learning model to predict fine-grained neighborhood socioeconomic status. The experimental results show that the gradient boosting decision tree regression model has the best prediction accuracy. Then, we verified the predicted significant correlation between fine-grained neighborhood socioeconomic status and criminal activity in the precinct by using a geographically weighted regression model, that is, criminal activity has a higher incidence in disadvantaged neighborhoods. It was also found that neighbourhood socioeconomic status was the best predictor of harassment and burglary.