Women are underrepresented as authors of invited articles in medical journals, but it is often assumed that this disparity is due to associations between gender and seniority or scientific output. We ask whether women are less likely to author an invited commentary compared to men with similar scientific expertise, seniority, and publication metrics. We use a case-control study design matched on field of expertise using natural language processing of published abstracts in Scopus, and control for other author-level covariates in conditional logistic regression models. For researchers who had been actively publishing for the median number of years in our dataset, the odds of invited commentary authorship were 21% lower for women compared to men with similar scientific expertise and publication metrics (95% confidence interval: 19% to 23%). For every one decile increase in years active, the odds for women compared to men decreased by a further 3.2% (95% confidence interval: 2.4% to 4.1%). In order to diversify authorship of solicited articles, natural language processing of bibliographic databases could be used to identify experts on prospective invited commentary topics.