Mathias Vacek won Stage 6 of the UAE Tour after a thrilling finish in Dubai, which saw the 19-year-old secure the success.