The global mpox epidemic in 2022 was likely caused by transmission of mpox virus (MPXV) through sexual contact networks, with New York City (NYC) experiencing the first and largest outbreak in the United States. By performing a phylogeographic and epidemiological analysis of MPXV, we identify at least 200 introductions of MPXV into NYC and 84 leading to onward transmission. Through a comparative analysis with human immunodeficiency virus (HIV) in NYC, we find that both MPXV and HIV genomic cluster sizes are best fit by scale-free distributions and that people in MPXV clusters are more likely to have previously received an HIV diagnosis (odds ratio=1.58;p=0.012) and be a member of a recently growing HIV transmission cluster, indicating overlapping sexual contact networks. We then model the transmission of MPXV through sexual contact networks and show that highly connected individuals would be disproportionately infected at the start of an epidemic, thereby likely resulting in the exhaustion of the most densely connected parts of the sexual network. This dynamic explains the rapid expansion and decline of the NYC outbreak, as well as the estimated cumulative incidence of less than 2% within high-risk populations. By synthesizing the genomic epidemiology of MPXV and HIV with epidemic modeling, we demonstrate that MPXV transmission dynamics can be understood by general principles of sexually transmitted pathogens.