Aims. We study the distribution of Wolf-Rayet (WR) stars and their subtypes with respect to their host galaxy light distribution. We thus want to investigate whether WR stars are potential progenitors of stripped-envelope core-collapse supernovae (SNe) and/or long-duration gamma-ray bursts (LGRBs). Methods. We derived the relative surface brightness (fractional flux) at the locations of WR stars and compared with similar results for LGRBs and SNe. We examined two nearby galaxies, M 83 and NGC 1313, for which a comprehensive study of the WR population exists. These two galaxies contain a sufficiently large number of WR stars and sample different metallicities. To enable the comparison, the images of the galaxies were processed to make them appear as they would look at a higher redshift. The robustness of our results against several sources of uncertainty was investigated with the aid of Monte Carlo simulations. Results. We find that the WC star distribution favours brighter pixels than the WN star population. WC stars are more likely drawn from the same distribution as SNe Ic than from other SN distributions, while WN stars show a higher degree of association with SNe Ib. It can also not be excluded that WR (especially WC) stars are related to LGRBs. Some differences between the two galaxies do exist, especially in the subtype distributions, and may stem from differences in metallicity. Conclusions. Although a conclusive answer is not possible, the expectation that WR stars are the progenitors of SNe Ib/c and LGRBs survives this test. The trend observed between the distributions of WN and WC stars, as compared to those of SNe Ib and Ic, is consistent with the theoretical picture that SNe Ic result from progenitors that have been stripped of a larger part of their envelope.