In forest fragments, rare habitats contribute to heterogeneity and may provide unique resources for frugivorous species like peccaries with spatially and temporally complex patterns of range use. This study examined seasonal habitat use by two sympatric peccary species (Tayassu pecari and Tayassu tajacu) in an Atlantic forest fragment on the plateau region of São Paulo state, Brazil. Previous studies showed that range use by T. pecari was highly nonrandom, and that both species persisted at population densities typical of larger forest fragments. To explain this, we quantified the use and availability of habitats and riparian zones with compositional analysis. Use by T. pecari was nonrandom with respect to availability. Habitat preferences were different during dry and wet seasons and corresponded closely with seasonal movements, core range and fruit use. Although aquatic habitats made up a small proportion of the herd home range, they were most preferred by T. pecari during both seasons. Headwater palmito Euterpe edulis swamps were most favored in the dry season, whereas swamps and marshes near larger streams were preferred in the wet season. Tayassu pecari preferred riparian zones <50 m from streams over drier zones. These habitats were important sources of fruits, travel routes and corridors between forest patches in the agricultural matrix. The least-preferred habitat of T. pecari during both seasons was disturbed forest edge dominated by bamboo. Habitat and riparian zone use were herd-specific for T. tajacu and related to habitat quality and composition where stable home ranges had been established. The persistence of viable peccary populations after 75 years of fragmentation-associated pressures is related to preservation of rare habitats and overall habitat diversity. Thus, T. pecari is an indicator of high habitat diversity in forest fragments and will function as an umbrella species when targeted for conservation.