Spacey serves as artistic director of the Old Vic, which puts on The 24 Hour Plays event to raise funds for the theatre's trust.
This year's (12) event had a melodic twist, with actors, writers and directors coming together to create a series of four musicals in the space of just 24 hours.
They showcased their new work on Sunday, with stars including Celia Imrie, Nigel Lindsay and Anthony Head taking to the stage.
Spacey and Goldblum then showed off their vocal talents, with the Jurassic Park actor playing the piano on a rendition of Me and My Shadow.
The event, which was hosted by British funnyman Matt Lucas, raised $160,000 (£100,000) to help maintain the Old Vic building and fund educational programs.