Major General Mehmet Cahit Bakir, the commander of Turkey's task force in Afghanistan, and Brigadier General Sener Topuc were detained at Dubai airport, said the official, who asked not to be named.
The detentions followed cooperation between the Turkish National Intelligence Organisation (MIT) and the UAE authorities, the state-run Anadolu news agency added, without giving further details.
Signup to our newsletter and follow us on Facebook and Twitter!
These are the first detentions of senior army figures serving outside Turkey as part of the investigation into the coup, which Ankara blames on the US-based preacher Fethullah Gulen.
In a separate development, the former governor of Istanbul Huseyin Avni Mutlu was detained in the coup investigation, Anadolu said.
More than 13,000 people, including over 100 generals, have been detained so far in a vast sweep in the wake of the July 15 military coup bid, prompting anxiety abroad over the scope of the crackdown.