Answer
Selim III was Mustafa IV's uncle. Selim III, born in 1761, was the Sultan of the Ottoman Empire from 1789 to 1807. Mustafa IV, born in 1779, succeeded Selim III as the Sultan after his deposition in 1807. Therefore, Selim III was the reigning Sultan when Mustafa IV was born and, as his paternal uncle, played a significant role in Mustafa IV's upbringing and early life.