Accurately estimating building heights is crucial for various applications, including urban planning, climate studies, population estimation, and environmental assessment. However, this remains a challenging task, particularly for large areas. Satellite-based Light Detection and Ranging (LiDAR) has shown promise, but it often faces difficulties in distinguishing building photons from other ground objects. To address this challenge, we propose a novel method that incorporates building footprints, relative positions of building and ground photons, and a self-adaptive buffer for building photon selection. We employ the Ice, Cloud, and Land Elevation Satellite 2 (ICESat-2) photon-counting LiDAR, specifically the ICESat-2/ATL03 data, along with building footprints obtained from the New York City (NYC) Open Data platform. The proposed approach was applied to estimate the heights of 17,399 buildings in NYC, and the results showed strong consistency with the reference building heights. The root mean square error (RMSE) was 8.1 m, and for 71% of the buildings, the mean absolute error (MAE) was less than 3 m. Furthermore, we conducted an extensive evaluation of the proposed approach and thoroughly investigated the influence of terrain, region, building height, building density, and parameter selection. We also verified the effectiveness of our approach in an experimental area in Beijing and compared it with other existing methods. By leveraging ICESat-2 LiDAR data, building footprints, and advanced selection techniques, the proposed approach demonstrates the potential to accurately estimate building heights over broad areas.