A few high-mass X-ray binaries–consisting of an OB star plus compact companion–have been observed by Fermi andground-based Cerenkov telescopes like High Energy Stereoscopic System (HESS) to be sources of very high energy (VHE;up to 30 TeV) γ-rays. This paper focuses on the prominent γ-ray source, LS 5039, which consists of a massive O6.5V starin a 3.9-day-period, mildly elliptical (e ≈ 0.24) orbit with its companion, assumed here to be an unmagnetized compactobject (e.g., black hole). Using three dimensional smoothed particle hydrodynamics simulations of the Bondi-Hoyle accretionof the O-star wind onto the companion, we find that the orbital phase variation of the accretion follows veryclosely the simple Bondi-Hoyle-Lyttleton (BHL) rate for the local radius and wind speed. Moreover, a simple model,wherein intrinsic emission of γ-rays is assumed to track this accretion rate, reproduces quite well Fermi observations ofthe phase variation of γ-rays in the energy range 0.1-10 GeV. However for the VHE (0.1-30 TeV) radiation observed by theHESS Cerenkov telescope,it is important to account also for photon-photon interactions between the γ-rays and the stellaroptical/UV radiation, which effectively attenuates much of the strong emission near periastron. When this is included,we find that this simple BHL accretion model also quite naturallyfits the HESS light curve, thus making it a strong alternativeto the pulsar-wind-shock models commonly invoked to explain such VHE γ-ray emission in massive-star binaries.