Fire source localization is a crucial task in building fire emergencies. Currently, incident commanders rely on reports from firefighters or on-site witnesses to locate the fire source, which can be dangerous and time-consuming. The study proposes an inverse modeling approach for fire source localization using machine learning. The approach builds a model to map the relationship between the fire source location and on-site temperature sensor measurements. The model is trained on simulated fire temperature data, and can be used to localize the fire source in real-time based on temperature data collected from stationary sensors or portable temperature measuring devices. The effectiveness of the proposed approach is demonstrated in a case study of a fire in an actual building floor.