The emergence of ultra-dense 5G networks and a large number of connected devices will bring with them significant increases in energy consumption, operating costs, and CO2 emissions. At the same time, the deployment of distributed photovoltaic (DPV) in megacities plays an important role in promoting the integration of “building-photovoltaic”, adjusting the city's clean energy supply system, and building a green, and low-carbon smart city. The development of a new “DPV-5G Base Station-Energy Storage (DPV-5G BS-ES)” coupled DC microgrid system and its pre-deployment investment costs are fundamental factors to be considered when the problem of large-scale DPV and BS deployment in cities has to be addressed. There are almost no published papers on this issue in the literature, which only consider the problem of maximizing the deployment of 5G BS service coverage or only perform optimization analyses for the performance of microgrid systems without considering the economic optimality and low-carbon green issues in the construction of urban utilities. In order to solve the problem of 5G BS deployment and economic optimization of topology in the “DPV-5G BS-ES” coupled DC microgrid system, a novel deployment strategy is proposed in this paper. The strategy is divided into: (a) The Geographic Information System (GIS) for extracting and analyzing 3D data from all buildings in the area. (b) A GIS-based formulation of a mixed integer quadratic constrained planning model (BSSCP) under discrete fixed radius coverage constraints is used to delineate building clusters within the area and determine the optimal deployment location of 5G BS under each sub-cluster. (c) An Improved Self-Organizing Mapping (ISOM) model combines GIS and microgrid performance parameters to address the economically optimal connection of grid lines for DPV in 3D space. (d) Simulation experiments were conducted for the power output and profitability of eight different PV panels and tracking systems to calculate the economically optimal type of DPV generation hardware. The experimental results show that the BSSCP model proposed in this study reduced the 5G BS deployment cost input by up to 35.8974 % compared to that of the control experimental model. Meanwhile, the ISOM model obtained an average reduction of 52.3741 % in the cost of connecting cables for the optimized 25 DPV planning and DC microgrid topology.