The fruit fly Drosophila melanogaster is a model organism to study several aspects of metazoan biology. Most of the work has been conducted in adult fruit flies, including laboratory and field‐derived specimens, but Drosophila melanogaster larvae recently became a valuable model to better understand animal physiology, development, or host–microbe interactions. While adult flies can be easily assigned to a given Drosophila species based on morphological characteristics, such visual identification is more intricate at the larval stage. This could explain the limited number of studies focusing on larvae, especially field‐derived samples. Here, we developed a polymerase chain reaction‐restriction fragment length polymorphism (PCR‐RFLP) assay that discriminates D. melanogaster from other ecologically relevant Drosophila species at the larval stage. The method, which targets the cytochrome oxidase I (COI) gene, was validated using laboratory‐derived larvae from seven D. melanogaster populations originating from different geographic areas as well as six Drosophila species. We further validated this PCR‐RFLP assay in a natural context, by identifying wild larvae collected in two locations in France. Notably, among all PCR‐RFLP profiles that matched the D. melanogaster species, 100% were correctly identified, as confirmed by COI sequencing. In summary, our work provides a rapid, simple, and accurate molecular tool to identify D. melanogaster from field‐collected larvae.