The main objective of this paper is to explore the dynamic causality between the fluctuations in oil prices and the trends observed in stock market indices of selected economies with oil-related characteristics. These countries include oil-importing nations such as Egypt and Tunisia, as well as one oil-exporting country, namely Oman. Our study uses monthly data spanning from January 2008 to February 2022. To investigate this causality, we adopt the rolling-window bootstrap causality test. The empirical results reveal that the causal relationship between stock market indices and oil prices is not stable, but rather fluctuates over time. Remarkably, these variations in causality coincide to important events, such as the sovereign debt crisis and the Covid-19 pandemic. This suggests that external shocks and exceptional events significantly influence the causal dynamics between oil prices and stock market in these countries. It is, therefore, crucial for policymakers and investors to take into account periods of economic uncertainty and major world events into their decision-making process. By adopting a proactive approach and carefully monitoring global economic indicators, they will be able to anticipate risks, adjust their strategies to meet economic challenges.