Lithuanian Aidis Kruopis finished third just ahead of Australian Mark Renshaw.
It was Cavendish's first success since winning the world road race title last September.
"It's obviously an extraordinary feeling," said the Isle of Man rider.
"I'm very happy. I was feverish two days ago, so I'm not 100per cent. And despite that I managed to beat a very impressive Boonen."
Boonen, who rides for the Omega Pharma-Quick Step team, holds the overall race lead after the 146km stage between Dukhan and the Al Gharafa Stadium here.
Wednesday's fourth stage will cover 144km from Al Thakira to Madinat Al Shamal in the north of the gas-rich Gulf state.
What the stars mean:
★ Poor ★ ★ Promising ★★★ Good ★★★★ Very good ★★★★★ Exceptional