It was a remarkable performance by the 37-year-old Ulsterman, who only a month ago broke his right shin and was only given the go-ahead to ride after intensive physiotherapy.
By Glen Helen on the opening lap, Dunlop was five seconds ahead and, despite the rain, had doubled his lead after the first of the three 37.73- mile laps of the Mountain Course.
The challenge of Gavin Lee disappeared after he was forced out by an oil leak, after which last year's race winner Lougher decided not to stop for fuel in order to close down Dunlop.
However, Dunlop maintained his lead to win by 18 seconds, with Owen McNally third. "I didn't feel pain from my leg, the problem was my ankle which was giving me some trouble - but this is my best ever win here," Dunlop said.