Soil sickness from the continuous cropping of cucumbers has become a major limiting factor for protected cucumber cultivation. The use of reasonable cropping systems and the employment of allelopathy between different crops are considered to be the major safe and effective measures for alleviating soil sickness. The objective of this study assessed the effects of garlic (Allium sativum L. cv. Yusuan No. 1)/cucumber (Cucumis sativus L. cv. Jinchun No. 4) relay intercropping on soil enzyme activities and the microbial environment in a continuous cropping regime. Cucumbers and garlic were selected and planted in plastic barrels. The following four treatments were included in the experiment: continuous cropping without crops (Cont), monoculture cucumbers (C), monoculture garlic (G), and the relay intercropping of garlic with cucumbers (CG). The results showed that relay intercropping with garlic promoted cucumber plant growth and attenuated damage caused by soil sickness. In comparison with the Cont treatment, the C treatment decreased soil urease, catalase, invertase, and phosphatase activities; by contrast, the CG treatment enhanced all soil enzyme activities. The C treatment resulted in lower numbers of soil bacteria and actinomycetes and a lower bacteria/fungi ratio, but there were a higher number of soil fungi than there were in the Cont treatment. However, the CG treatment increased the numbers of soil bacteria and actinomycetes as well as the bacteria/fungi ratio, and it decreased the number of soil fungi. In comparison with the Cont treatment, the C treatment reduced the microbial biomass carbon (MBC) and soil basal respiration (BSR) without affecting the metabolic quotient (qCO2), whereas the CG treatment increased all three variables. A polymerase chain reaction denaturing gradient gel electrophoresis (PCR-DGGE) analysis revealed decreased bacterial community diversity and increased fungal community diversity in soil with the C treatment; the opposite trend was observed in the CG treatment. The results indicated that the relay intercropping of garlic with cucumbers improved soil enzyme activities and promoted the conversion of continuous cropping soil from a “fungal” type to a “bacterial” type. Additionally, relay intercropping altered the soil bacterial community structure, increased the bacterial diversity indices, and enriched the dominant bacterial populations in the soil. These mechanisms improved the soil microbial environment and effectively alleviated damage caused by soil sickness, thus promoting cucumber plant growth.