In this paper, factors controlling natural gas accumulation in the southern margin of Junggar Basin were mainly discussed by a comparison with natural gas generation and accumulation in the Kuqa Depression of Tarim Basin. The southern margin of Junggar Basin and the Kuqa Depression of Tarim Basin are located on the north and south sides of the Tianshan Mountains respectively, and they share the similar sedimentary stratigraphy and tectonic evolution history. In recent several decades, many large gas fields have been found in the Kuqa Depression of Tarim Basin, but no great breakthrough in the southern margin of Junggar Basin. Our results suggest that natural gas in the southern margin of Junggar Basin is mainly thermogenic wet gas, and can be divided into three types as coal-derived gas, mixed gas and oil-associated gas, of which the former two types are dominated. The Jurassic coal measures are the main source rocks of natural gas, and the main gas generation time from this set of source rocks matched well with the formation time of the anticline structures, resulting in favorable conditions for natural gas accumulation. In the western part of the southern margin in the Junggar Basin, the Permian lacustrine and the Upper Triassic lacustrine-swamp source rocks could be important sources of natural gas, and the main gas generation time also matched well with the formation time of traps. Compared with the Kuqa Depression of Tarim Basin, natural gas sources are better in the southern margin of Junggar Basin, and the geologic conditions are favorable for the formation of large oil and gas fields in the southern margin of Junggar Basin. The deep Permian-Jurassic-Cretaceous petroleum system is the most favorable petroleum system for natural gas exploration in the southern margin of Junggar Basin. The western part and the central part of the southern margin in the Junggar Basin could be the first targets for the discovery of the Jurassic coal-derived oil and gas reservoirs. The shallow Cretaceous-Neogene petroleum system is the second target for natural gas exploration.