Rodents establish dominance hierarchy as a social ranking system in which one subject acts as dominant over all the other subordinate individuals. Dominance hierarchy regulates food access and mating opportunities, but little is known about its significance in other social behaviors, for instance during collective navigation for foraging or migration. Here, we implemented a simplified goal-directed spatial task in mice, in which animals navigated individually or collectively with their littermates foraging for food. We compared between conditions and found that the social condition exerts significant influence on individual displacement patterns, even when efficient navigation rules leading to reward had been previously learned. Thus, movement patterns and consequent task performance were strongly dependent on contingent social interactions arising during collective displacement, yet their influence on individual behavior was determined by dominance hierarchy. Dominant animals did not behave as leaders during collective displacement; conversely, they were most sensitive to the social environment adjusting their performance accordingly. Social ranking in turn was associated with specific spontaneous neural activity patterns in the prefrontal cortex and hippocampus, with dominant mice showing higher firing rates, larger ripple oscillations, and stronger neuronal entrainment by ripples than subordinate animals. Moreover, dominant animals selectively increased their cortical spiking activity during collective movement, while subordinate mice did not modify their firing rates, consistent with dominant animals being more sensitive to the social context. These results suggest that dominance hierarchy influences behavioral performance during contingent social interactions, likely supported by the coordinated activity in the hippocampal-prefrontal circuit.