Kevin Barry's Beatlebone is described as a novel "that takes its reader to the edge - of the Western world, of sanity, of fame, of words".
"Intricately weaving and blurring fiction and life, Beatlebone embodies beautifully this prize's spirit of creative risk," said judge Josh Cohen.
Barry, who beat five other contenders, was awarded a Â£10,000 prize.
His novel is set in Dorinish, an uninhabited island off the Irish coast, which Lennon bought in 1967 for Â£1,700.
Set in 1978, it follows the former Beatle as he visits the island to attend a course of primal scream therapy.
The author described it as "a play for voices".
"I had no idea what I was working on for a long time with the novel Beatlebone," Barry said, ahead of the award ceremony on Wednesday.
"I thought it might be a radio documentary, I thought it might be an essay, I thought it might be a play... it's ended up as being kind of all of these things."
Barry's previous works include City Of Bohane and two short stories, Dark Lies The Island and There Are Little Kingdoms.
The Goldsmiths Prize was founded in 2013 "to reward fiction that breaks the mould or opens up new possibilities for the novel form".
Author Eimear McBride, one of the judges of the 2015 prize, won the inaugural prize for her work A Girl Is A Half-formed Thing, while last year saw Ali Smith triumph with her novel How to be Both.
Smith has described the Goldsmiths Prize as "a miracle".
"The change it's made is that publishers, who never take risks in anything, are taking risks on works which are much more experimental than they would've two years ago," said Smith. "That to me, is like a miracle."
The panel of four judges for this year's prize included McBride, Professor Cohen (chair), author Jon McGregor and journalist Leo Robson.
A fictional book about John Lennon has won the Goldsmiths Prize, celebrating the novel at its most innovative.