Gospel of Thomas
A similar episode occurs in the apocryphal Gospel of Thomas (verse 100), but there the coin in question is gold.