Fatty acid binding protein 4 (FABP4), reversibly binding to fatty acids and other lipids with high affinities, is a potential target for treatment of cancers. The binding site of FABP4 is buried in an interior cavity and thereby ligand binding/unbinding is coupled with opening/closing of FABP4. It is a difficult task both experimentally and computationally to illuminate the entry or exit pathway, especially with the conformational gating. In this report we combine extensive computer simulations, clustering analysis, and the Markov state model to investigate the binding mechanism of FABP4 and troglitazone. Our simulations capture spontaneous binding and unbinding events as well as the conformational transition of FABP4 between the open and closed states. An allosteric binding site on the protein surface is recognized for the development of novel FABP4 inhibitors. The binding affinity is calculated and compared with the experimental value. The kinetic analysis suggests that ligand residence on the protein surface may delay the binding process. Overall, our results provide a comprehensive picture of ligand diffusion on the protein surface, ligand migration into the buried cavity, and the conformational change of FABP4 at an atomic level.