The intensity with which males deliver courtship and the frequency with which they mate are key components of male reproductive success. However, we expect the strength of the relationship between these traits and a male’s overall paternity to be strongly context dependent, for example to be altered significantly by the extent of post-mating competition. We tested this prediction in a lekking insect, Ceratitis capitata (medfly). We examined the effect of manipulating the sex ratio from male- to female-biased (high and low male competition, respectively) on courtship behaviour, mating frequency and paternity of focal males. Under high male competition, focal males delivered significantly more courtship but gained lower paternity than under lower competition. Paternity was positively associated with mating frequency and small residual testes size. However, the association between mating frequency and paternity was significantly stronger under low competition. We conclude that manipulation of sex ratio significantly altered the predictors of mating success and paternity. The relationship between pre- and post-mating success is therefore plastic and alters according to the prevailing level of competition. The results highlight the importance of post-copulatory processes in lekking species and illuminate selection pressures placed on insects such as medflies that are mass reared for pest control.