Coxinga ... was said to have greatly impressed the bookish Emperor of Intense Warring [the remaining Ming pretender who had retreated to Fuzhou as the Manchus invaded]. Still only a youth of twenty-one, the former Confucian scholar was made assistant controller of the Imperial Clan Court. The childless Emperor also commented that he was disappointed not to have a daughter he could offer to Coxinga in marriage, and bestowed him with a new name. Once Lucky Pine [Fukumatsu], then Big Tree [Da Mu, a nickname from Sen 'Forest'], the boy was now given the appellation Chenggong, thereby making his new given name Zheng Chenggong translate literally as 'Serious Achievement'. In a moment of supreme pride for his family, the boy was also conferred with the right to use the surname of the Ming ruling family itself. It amounted to a symbolic adoption, and he was often referred to as Guoxingye, the Imperial Namekeeper. Pronounced Koksenya in the staccato dialect of Fujian, and later transcribed by foreign observers, the title eventually transformed into the 'Coxinga' by which he is known to history.SOURCE: Coxinga and the Fall of the Ming Dynasty, by Jonathan Clements (Sutton, 2005), p. 124
UPDATE: As usual, Language Hat's learned commentariat sheds more light on the topic, among them Andrew West:
Early Portuguese accounts of China frequently use "x" in romanizing Chinese names (Xanadu from Xangdu from Shangdu 上都 is a well-known example). On the other hand, when does Dutch use "x" rather than "ks"?
Looking at the original Dutch translation of the letter from Coxinga to Frederick Coyett dated 1662, (images of the manuscript are available here), his name is consistently given as "Coxinja" rather than "Coxinga". Googling also produces a lot of Dutch pages which refer to the "Zeeroover Coxinja". Coxinja certainly gives a better representation of the final syllable of the Chinese Guoxingye.
In "An Introduction to Taiwanese Historical Materials in the Archives of the Dutch East India Company" here, Coxinga's name is apparently spelled as "Cocxinja" in the Dutch sources, which supports the hypothesis that the "x" in his name represents the initial sound of the second syllable rather than a combination of the final sound of the first syllable and first sound of the second syllable.
So I wonder when the spelling "Coxinga" is first attested?