Honey bees and wild bees provide critical pollination services to agricultural ecosystems; however, the relative contributions of different bee taxa are not well understood. The natural habitats surrounding farmland support food and nesting resources for wild bees and therefore play an important role in the maintenance of crop pollination. In this study, we selected Cucurbita pepo L. (squash) as a model crop to investigate the relative importance of honey bees and bumblebees in pollinating the crop. Thirteen fields, which were surrounded by a gradient of natural habitat, were investigated on the Yunnan-Guizhou Plateau in China. We measured the visit densities of honey bees and bumblebees, the number of pollen grains deposited in a single visit by the two bee taxa, as well as the overall pollen grains deposited on stigmas during a flowering day, and then used Bayesian inference to decouple the pollen grains deposited by either the honey bees or the bumblebees. Compared with honey bees, bumblebees deposited a higher number of pollen grains on stigmas in a single visit, but had a lower visit density than honey bees. Meanwhile, the bumblebee visit density increased along the proportion of natural habitat, while the honey bee visit density was not affected by the surrounding natural habitat. Data simulations using Bayesian inference showed that on a flowering day, the number of pollen grains deposited by bumblebees increased with the proportion of natural habitat in the surrounding landscape, but the number of pollen grains deposited by honey bees did not. Moreover, the total numbers of pollen grains deposited by honey bees or bumblebees alone were all below 2000 (the critical level to satisfy the pollination requirement of this crop). Pollen calculations demonstrated that the number of pollen grains deposited by the two bee taxa was greater than 2000 in fields surrounded by more than 13% natural habitat (grasslands and forests). The results revealed that bumblebees ensured C. pepo pollination in combination with honey bees in the highland agricultural ecosystems.