The author of such grisly titles as The Torment of Others, Fever of The Bone and Beneath The Bleeding has stepped in to help the Kirkcaldy-based Scottish Championship side, which will carry the logo for her website.
The lifelong fan already sponsors a stand at Stark's Park in honour of her father Jim, a former scout for the team.
Ms McDermid, who is based in north-east England, said: "The benefit has never been clearer than in this coming season. With the arrival of Rangers, Hibernian and Hearts in our division, there will be many more visitors to Stark's Park.
"There will be massively more media interest, with photographers and TV cameras sending images of our ground and our players all round the world."
Commercial director Tom Morgan said: "It is an honour for a provincial club like Raith Rovers to be involved with a world-famous author."