Yes. Marigold and Pumpkin have a documented companion-planting benefit. Virginia Cooperative Extension lists marigold as a companion for pumpkin.
This is a practical yes, not a magic guarantee. Keep the normal spacing for Marigold and Pumpkin, watch airflow and watering, and treat the companion note as one useful planning signal alongside sunlight, soil, and harvest timing.
Source basis: Virginia Cooperative Extension companion planting chart. The page does not add extra pest-control or yield claims beyond the sourced fact row.
Spacing tip: Leave vine crops room to run, or use a trellis so the companion is not shaded or smothered.