It is significant to identify urban active faults for human life and social sustainable development. The ordinary methods to detect active faults, such as geological survey, artificial seismic exploration, and electromagnetic exploration, are not convenient to be carried out in urban area with dense buildings. It is also difficult to supply information about vertical extension of the deeper faults by these methods. Gravity, reflecting the mass distribution of the Earth's interior, provides an alternative way to detect faults, which is more efficient and convenient for urban active fault detection than the aforementioned techniques. Based on the multi-scale decomposition of gravity anomalies, a novel method to invert multilayer horizontal tectonic stresses is proposed. The inverted multilayer stress fields are further used to infer the distribution and stability of the main faults. In order to validate our method, the multilayer stress fields in the Shenzhen fault zone are calculated as a case study. The calculated stress fields show that their distribution is controlled significantly by the strike of the main faults and can be used to derive depths of the faults. The main faults in Shenzhen may range from 4 km to 20 km in the depth. Each layer of the crust is nearly equipressure since the horizontal tectonic stress has small amplitude. It indicates that the main faults in Shenzhen are relatively stable and have no serious impact on planning and construction of the city.