The contact line (CL) is where solid, liquid, and vapor phases meet, and Young’s equation describes the macroscopic force balance of the interfacial tensions between these three phases. These interfacial tensions are related to the nanoscale stress inhomogeneity appearing around the interface, and for curved CLs, e.g., a three-dimensional droplet, another force known as the line tension must be included in Young’s equation. The line tension has units of force, acting parallel to the CL, and is required to incorporate the extra stress inhomogeneity around the CL into the force balance. Considering this feature, Bey et al. [J. Chem. Phys. 152, 094707 (2020)] reported a mechanical approach to extract the value of line tension τℓ from molecular dynamics (MD) simulations. In this study, we show a novel thermodynamics interpretation of the line tension as the free energy per CL length, and based on this interpretation, through MD simulations of a quasi-static detachment process of a quasi-two-dimensional droplet from a solid surface, we obtained the value τℓ as a function of the contact angle. The simulation scheme is considered to be an extension of a thermodynamic integration method, previously used to calculate the solid–liquid and solid–vapor interfacial tensions through a detachment process, extended here to the three-phase system. The obtained value agreed well with the result by Bey et al. and showed the validity of thermodynamic integration at the three-phase interface.