Competition for limiting resources is a fundamental and well-established driver of niche partitioning, which in turn promotes species coexistence and biodiversity. Although contests are a well-known behavioural mechanism by which organisms compete over limiting resources, there has been surprisingly little application of contest theory to understanding interspecific interactions, niche partitioning, species coexistence and biodiversity. We investigated the link between contest dynamics and community structure using two intertidal rockpool fishes, Bathygobius cocosensis (Gobiidae) and Lepidoblennius haplodactylus (Tripterygiidae), as model species. We assessed the abundance and distribution of the two species on intertidal rocky shores of South-East Australia, and whether distribution patterns were related to abiotic variables. We then conducted interspecific contest experiments between pairs of B. cocosensis and L. haplodactylus of varying size and sex under high and low dissolved oxygen levels to assess the competitive dominance of the species. To relate these results to community structure, we quantified temporal patterns of rockpool fidelity of each species in situ. Field surveys revealed that B. cocosensis was most prevalent in rockpools with higher dissolved oxygen, and L. haplodactylus was most prevalent in rockpools that contained no B. cocosensis. Contest experiments revealed that B. cocosensis displayed higher resource holding power than L. haplodactylus regardless of size asymmetry, sex or dissolved oxygen concentration, although contest intensity was influenced by relative body size of competing individuals. Furthermore, the microhabitat preference of L. haplodactylus was modulated in the presence of B. cocosensis. In the field, B. cocosensis displayed higher rockpool fidelity than L. haplodactylus. In light of these findings, we propose that B. cocosensis is the superior competitor but persistence of both species is likely facilitated by low-cost contest resolution strategies, plasticity in microhabitat preference, negative spatial co-variation and interspecific variation in dispersal and corresponding home range sizes. By using contest theory to understand the dynamics of interspecific contests, insight has been gained into how habitat is partitioned, species coexist and ultimately how biodiversity is maintained. A lay summary is available for this article.