The stomach contents of 1261 striped marlins caught from 2007 to 2010 by the sport-fishing fleet of Cabo San Lucas, Baja California Sur, Mexico, were analysed, taking into account sea surface temperatures estimated using satellite images of the study area and the Oceanic Niño Index (ONI). The analysis allowed the identification of three anomalously cold periods during 2007, 2008 and 2010 and a warm period in 2009. The stomach content results showed 89 different prey items eaten during the study period. Of the specimens captured, 868 (69%) stomachs contained food items. The most important prey items were cephalopods (Dosidicus gigas and Argonauta spp.) and fish (Scomber japonicus, Selar crumenophthalmus and Sardinops caeruleus). Despite having a broad trophic spectrum, the striped marlin was classified as a specialist consumer, with Bi = 0.03. Based on the diet breadth value and the prey-specific index of relative importance (PSIRI), the jumbo squid, D. gigas, was the main prey species, coinciding with cold periods. On the other hand, the fishes S. caeruleus and S. japonicus showed the highest PSIRI values during the 2009 warm anomalies. Analysis of similarity showed the formation of four groups in relation to PSIRI values. According to a non-metric multidimensional scaling ordination, these groups were formed with a similarity of 30% and a stress of 0.17. These results demonstrate inter-annual variation in the diet as well as in the availability and abundance of prey items.