A surface-enhanced Raman spectroscopy (SERS) substrate made of agar gel coupled with silver nanoparticles has been applied to the micro-extraction and the ultra-sensitive detection of dyes on pieces of textile of different nature (silk, wool, and printed cotton) and on a mock-up panel painting. In particular, the Ag-agar gel substrate previously developed has been improved by the addition of the chelating agent ethylenediaminetetraacetic acid (EDTA), which has been found to play an important role as a stabilizer of the nanocomposite matrix and for the improvement of the micro-extractive performances of the gel. The system has been confirmed to be non-destructive and minimally invasive, showing a better capability of trapping the dye molecules inside its structure. Ag-agar gel-EDTA has been an invaluable and powerful tool for the characterization of the dye present in a printed cotton sample of unknown chemical composition. SERS analyses, performed on the dried cube of gel following extraction on the sample, have allowed for the identification of the dye. SERS results have been corroborated by high-performance liquid chromatography analyses. The possibility of easily detecting compounds at very low concentration coupled with the high sensitivity of SERS makes this technique a valid and versatile method for the non-destructive recognition of chemicals in works of art. Copyright © 2014 John Wiley & Sons, Ltd.