After taking overall lead on Stage 3, Chaves held on in the finale to top the final general classification ahead of Fabio Aru (Astana) and Team Sky's Wout Poels.
"The plan was to keep the red jersey," Chaves said. "Everything went perfectly. We tried to keep the breakaway at two minutes. We sent (Cameron) Meyer and (Sam) Bewley to the front, and they worked very hard. Then, towards the end, Sky worked for the stage win, and it was good for us."
After 20 laps of the motor racing track at Yas Marina, Viviani denied road world champion Peter Sagan (Tinkoff-Saxo) in the tightest of finishes with Andrea Guardini of Astana third.
"On this stage it was very important to do the work and take a good position into the last corner," Viviani said. "When I saw (Daniele) Bennati and (Daniel) Oss in front of me I thought, 'okay these guys are fast but not faster than me'.
"It was perfect because they had a good progression, and when I decided to go I could go. I knew it would be easier to stay at the front. It was a close finish but when I crossed the line I knew immediately that I had won."
Abu Dhabi Tour stage winners
Stage 1: Andrea Guardini (Astana)
Stage 2: Elia Viviani (Team Sky)
Stage 3: Esteban Chaves (Orica-GreenEDGE)
Stage 4: Elia Viviani (Team Sky)