In ecological systems, heterogeneous interactions between pathogens take place simultaneously. This occurs, for instance, when two pathogens cooperate, while at the same time, multiple strains of these pathogens co-circulate and compete. Notable examples include the cooperation of human immunodeficiency virus with antibiotic-resistant and susceptible strains of tuberculosis or some respiratory infections with Streptococcus pneumoniae strains. Models focusing on competition or cooperation separately fail to describe how these concurrent interactions shape the epidemiology of such diseases. We studied this problem considering two cooperating pathogens, where one pathogen is further structured in two strains. The spreading follows a susceptible-infected-susceptible process and the strains differ in transmissibility and extent of cooperation with the other pathogen. We combined a mean-field stability analysis with stochastic simulations on networks considering both well-mixed and structured populations. We observed the emergence of a complex phase diagram, where the conditions for the less transmissible, but more cooperative strain to dominate are non-trivial, e.g. non-monotonic boundaries and bistability. Coupled with community structure, the presence of the cooperative pathogen enables the coexistence between strains by breaking the spatial symmetry and dynamically creating different ecological niches. These results shed light on ecological mechanisms that may impact the epidemiology of diseases of public health concern.