The Italian Astana rider claimed victory by nine seconds over Frenchman Romain Bardet in the 180km ‘Green Mountain’ stage from Knowledge Oasis Muscat to the climb of Jabal al-Akhdhar.
In the overall standings, Nibali has a 15sec lead on Bardet with two stages remaining.
The Italian, who also won on Jabal al-Akhdhar in 2012, said: “The first time was completely different because I attacked from the foot. Today I had to keep my nerve and wait until the end.”
Jakob Fuglsang of Denmark, Nibali’s team-mate, was third while previous race leader Edvald Boasson Hagen, the Norwegian, finished 10th, 1min 10secs behind the stage winner.
Saturday’s penultimate fifth stage is a shorter 119.5km ride from Yiti to the Ministry of Tourism.