Jonathan. Intrigued by your question I did a bit of hunting; "The War for All the Oceans: From Nelson at the Nile to Napoleon at Waterloo" by Roy & Lesley Adkins. Hachette. Chapter 4, Page 61, quotes Cornelia Knight [a contemporary observer and friend of the Hamilton's] stating that Francesco Caracciolo was a Commodore, taken in arms against the forces of his sovereign. As a representative of King Ferdinand, Nelson temporarily made HMS Foudroyant a Neapolitan ship, for the Court Martial of Commodore Caracciolo. He was tried by a Court Martial of [five] Neapolitan officers for commanding the rebel gunboats and firing upon a Sicilian warship, and was subsequently hanged from the foremast yard-arm of the Neapolitan frigate La Minerve.
In "Nelson: Sword of Albion" by John Sugden, there is a fulsome account at page 252. The facts are also recounted in "The Life of Nelson" by Robert Southey.