ESTHER FREUD and I should be sitting amid guttering candles in a room thick with shadows despite a log fire and velvet curtains drawn against midnight fog.

It would be a more fitting setting for the strange tale she has to tell than the sunny north-west London cafe where we lunch surrounded by the clatter of yummy mummies and their offspring.

Nevertheless, the slender, raven-haired, mobile-featured Freud manages to unsettle me. For the acclaimed 51-year-old author of seven novels is telling me a ghost story and it's not a work of fiction, although we are here to discuss her poignant eighth novel, Mr Mac And Me, which tells of an unlikely friendship between the great Charles Rennie Mackintosh and a lame 12-year-old boy, Thomas Maggs, during the First World War.

The atmospheric setting for the haunting tale Freud relates to me when we meet is also that of her beautiful book: the Suffolk coast. Some 15 years ago, although London-based, she and her husband - the actor David Morrissey, with whom she has three children - bought a cottage in the village of Walberswick, which she had been visiting for many years.

Her grandparents, whom she never met, migrated there when they left Germany in the 1930s. She's written that her late father, the painter Lucian Freud, was "rebellious and private to the extent that he preferred not to introduce his children to his parents". (Well, he did father lots of children, 15 at the last count, as Freud cheerfully acknowledges.)

She staged her own "private rebellion", however, by being "sentimental and nostalgic", loving things her father (the grandson of Sigmund Freud) spurned. Lucian thought Walberswick dreary, but she fell in love with it.

Their historic house, once the village inn, had been owned by an elderly Jewish couple. Previously it had belonged to a cousin of Lucian's and, before that, to another refugee, a psychoanalyst from Vienna. The sellers wanted it to stay in the Freud family, but had one eccentric stipulation - everything must stay and they meant everything.

"Each person who had lived there had left behind all their belongings," she sighs. "We're terrible hoarders anyway, so we spent years sifting through stuff, agonising over which of many tea cosies, say, we should keep. There were drawers full of objects, all labelled."

In a shoe box she found a newspaper article about Charles Rennie Mackintosh, who had stayed at the inn in 1914 but, sadly, there were none of his prints or sketches among the many on the walls - just a framed postcard, Fritillaria, 1915, bearing his and his wife, Margaret McDonald's initials. (This iconic image is on the dust jacket of Freud's novel.)

"The article told how he had died penniless and forgotten in 1928 but how, since the late 1980s, his genius was finally being acknowledged. I was sure he must have stayed in the best room in the house; then I discovered that he had stayed in the worst room, which he sometimes shared with the landlord's young son, even when Mackintosh came in drunk."

Aside from the mountains of bric-a-brac, Freud inherited something else with the house: a shadowy presence hovering in the back hall where there was always a damp patch. "At night, whenever I went to the downstairs bathroom, I always acknowledged him saying, 'I know you are there, it's all right,' quietly under my breath. No one else in the family ever knew," she confesses. (Indeed, Morrissey recently tweeted, "I lived with a ghost and never knew it.")

"It was a bit scary just in that place, although I never saw anything," Freud continues. "I just knew it was a boy, aged maybe 10 or 12, in short trousers and a cap. I imagined he had come with the old house, that he had one lame leg but that he didn't wish me ill."

So, she began writing a ghost story, set in the present day in her house, about a family renovating the old place, with flashbacks to this boy and featuring Mackintosh in a walk-on role. She spent 18 months writing, then realised it was terrible. "I saved the sub-plots - only seven pages, sadly - and threw the rest away as I had got bogged down in uninteresting stuff about new fitted kitchens! Then I thought that maybe the ghost had a voice, that he should tell the story.

"Suddenly the opening came to me, I knew the boy was the son of the publican, that his name was Thomas Maggs and that the book would begin, 'I was born upstairs in the small bedroom, not in the small room with the outshot window, where I sleep now, or the main room that is kept for guests...' and that was it. I was off."

Happily so for her many devoted readers, because Mr Mac And Me is perhaps Freud's finest, most heartfelt book, written in shimmering prose - and that's saying something since, following the publication of her second novel, Peerless Flats (1993), she was named, alongside Jeanette Winterson and Kazuo Ishiguro, among others, one of Granta's best young British novelists. Her best-selling first novel, Hideous Kinky, about her peripatetic childhood in Morocco, became a movie starring Kate Winslet.

Her work has often drawn on autobiographical details, although she prefers to write about what she doesn't know. It's still tempting, though, to assume that, as the daughter of the greatest artist of our times, she deliberately chose to write about another painter, another genius. "I honestly hadn't thought about it that way," she responds. It was only after it was pointed out to her that her book paints a wonderful portrait of how an artist works through the eyes of a child, that she realised how much watching her father at work had taught her about the artistic process. She remembers, when he lived opposite Paddington Station, unusually for him as a figurative artist, he spent months painting a view of the station from his windows.

"As a child, I'd go there and he'd still be working on that painting for what seemed like forever. At one point, he'd painted a green bicycle chained to some railings, which I liked. The next time I went it was gone; he'd painted over it. When I asked why, he said that it was because of the eye. I wasn't sure what he meant. Now I know that it was leading the eye to the wrong place. I think that, like my father, Mackintosh was driven to paint. I've got so much love and affection for Mackintosh."

Months of research followed Freud's decision to focus on "Toshie", although she's always disliked research. "I rather like it now, I found out so many wonderful things." She visited the Hunterian Art Gallery, in Glasgow, gained access to the Mackintosh archive, including some recently discovered letters, read countless memoirs of Suffolk during the Great War, learnt about the herring girls who travelled for three days from Scotland annually to gut the silver darlings caught off the Suffolk coast, which leads to a tender adolescent love story in her novel. She also discovered how to dab for eels, skin a rabbit and make rabbit glue - a gift Thomas prepares for the flame-haired Margaret McDonald's gesso work.

Then there were the hours spent gazing at Mackintosh's luminous flower paintings, many made in Suffolk. "I'd stare and stare at them. One day I realised he'd hidden tiny birds in each one. I thought I'd made a major discovery. Of course, I hadn't!" she laughs.

Most importantly, though, she delved into Mackintosh's tragic life story, particularly the shattering events that overtook him in Suffolk when locals mistook him for a German spy - they were suspicious of his guttural Glaswegian accent, among other things.

Inevitably, while writing her novel she spent time in Mackintosh's masterpiece, the Glasgow School of Art. She had begged for an extra day to correct the final proofs of her novel, in May, and was poring over the pages when a friend called with news of the devastating fire. "I felt heartbroken for Mackintosh - he had so much bad luck. I was sad for him and Glasgow. It seemed extraordinary timing, but it's fantastic that so much was saved by the amazing fire service. It's such a treasured building."

So, does she still believes in ghosts? "Oh yes," Freud responds, her huge, expressive, dark eyes lighting up. "I used to spend a lot of time in the Borders in a grand historic house, the home of another writer. It was very haunted. We would all run to the loo en masse! I've often been aware of ghosts, though. With girlfriends I once shared a house that really was scarily haunted. But, you know, that's why the ghost story I wrote originally didn't work, because 'my' ghost wasn't remotely scary."

There are no ghosts from the past in her Suffolk life now. The family sold their Walberswick cottage. When she finished writing Mr Mac And Me, she revisited their old house - now much renovated. Light drenched the dark, back hall, that spooky damp patch had vanished. She called to Thomas. Answer came there none. "I'm glad to have taken him with me."

Mr Mac And Me by Esther Freud is published by Bloomsbury, £16.99. Esther Freud discusses Mr Mac And Me at the Hunterian Art Gallery, Glasgow on Sunday, October 12, part of the Creative Mackintosh Festival 2014