Farnesyltransferase (FTase) and geranylgeranyltransferase type-I (GGTase-I) are two members of protein prenyltransferases, which play critical roles in lipid post-translational modifications. Potent inhibitors of FTase and GGTase-I have been confirmed to show favorable influence on the therapies of various diseases, such as cancers, malaria and Toxoplasmosis. However, designing highly specific inhibitors toward FTase or GGTase-I without influencing their binding affinity remains a big challenge. In this work, molecular docking, molecular dynamics (MD) simulations and MM/GBSA free energy calculations were employed to study the bindings of two highly selective inhibitors (lonafarnib and GGTI-2133) towards FTase or GGTase-I. The specificities of the studied inhibitors derived from the predicted binding free energies are consistent with the experimental data. The analysis of the energetic components illustrates that both the non-polar and polar interactions play critical roles in determining the specificity between FTase and GGTase-I. Moreover, the protein-inhibitor interaction spectra for the studied inhibitors were determined through the decomposition of the binding free energies, and the important residues for binding and specificity were highlighted. Our study provides useful information for the rational design of selective FTase or GGTase-I inhibitors.