While Esperanto orthography uses a diacritic for its four postalveolar consonants, as do the Latin-based Slavic alphabets, the base letters are Romano-Germanic.
Ĝ is based on the letter g, which has this sound in English and Italian before the vowels i and e (with some exceptions in English), to better preserve the shape of borrowings from those languages (such as ĝenerala from general) than Slavic đ (Serbo-Croatian) or dž would.
In Haida, a language isolate, the letter ĝ was sometimes used to represent pharyngeal voiced fricative /ʕ/.
In Aleut, an Eskaleut language, ĝ represents a voiced uvular fricative /ʁ/.
In Dutch, the letter ĝ is used in some phrase books and dictionaries for pronunciation help.