Abstract Freshwater ecosystems are threatened by the introduction of invasive species. Generalist invaders often compete with native species for shared resources, resulting in possible native species niche displacement. However, environmental heterogeneity may modulate the level of individual specialisation in invasive species, altering the outcome of interspecific competition between invasive and native species. The objectives of our study were to (1) evaluate the environmental context of dietary specialisation and trophic position of an invasive species according to the Environmental Matching Hypothesis (EMH), and (2) consider how the environmental context of invasive species dietary resource use may influence the dietary niche of native species competing for similar resources. Resource use, trophic position and dietary niche were determined using gut content and stable isotope analyses for the invasive round goby (Negobius melanostomus) and the native yellow perch (Perca flavescens), along environmental gradients in an invaded fluvial ecosystem. Our results were in support of EMH for the invader diet and resource specialisation, but not trophic position. Under environmental conditions of high water‐conductivity, round gobies were generalists feeding mostly on pelagic prey. Under more challenging environmental conditions of low water‐conductivity, the invader specialised on preferred high‐quality benthic prey. The ecological impact of the round goby was greatest at low water‐conductivity sites where the invader was a benthic specialist; there was a greater relative dietary niche overlap between the invader and the native species. Our study uniquely illustrates how invasive species’ resource specialisation can be modulated by spatial environmental heterogeneity within ecosystems, and how this can subsequently alter the ecological impact of the invader on native species in aquatic food webs.