Capture-recapture is a common tool in epidemiology to estimate the size of “hidden” populations and correct the under-ascertainment of cases, based on incomplete and overlapping lists of the target population. Log-linear models are often used to estimate the population size yet may produce implausible and unreliable estimates due to model misspecification and small cell sizes. A novel Targeted Minimum Loss-based Estimation (TMLE) model developed for capture-recapture makes several notable improvements to conventional modeling: “targeting” the parameter of interest, flexibly fitting the data to alternative functional forms, and limiting bias from small cell sizes. Using simulations and empirical data from the San Francisco Department of Public Health’s HIV surveillance registry, we evaluated the performance of the TMLE model and compared results to other common models. Based on 2,584 people observed on three lists reporting to the surveillance registry, the TMLE model estimated the number of San Francisco residents living with HIV as of 12/31/2019 to be 13,523 (95% CI: 12,222 – 14,824). This estimate, compared to a “ground truth” of 12,507, was the most accurate and precise of all models examined. The TMLE model is a significant advancement in capture-recapture studies, leveraging modern statistical methods to improve the estimation of hidden populations.