I would like to propose a different idea of magic. Instead of weighing the classic DnD, why not use occult grimoires and exoteric philosophy bases to generate a unique and deep taste for magic in Dwarf Fortress.
Astral magick, Theurgy, there is books where we can take inspiration like The Aim of the Sage - Picatrix(Ghāyat al-Ḥakīm), Shams al-Ma'arif (the Book of the Sun of Gnosis and the Subtleties of Elevated Things), Enochian magick, Solomonic Magick
Alchemy - Natural Magick, The Summa Perfectionis of Pseudo-Geber
These books can provide a base for the procedural generation of rites, talismans, or any other magickal thing in the world, here are some examples of texts from the books:
This is from the book Picatrix:
16th lunar mansion al-Zubana (from 12d 51m 26s to 25d 42m 52s Libra). Here talismans are made to destroy trade, seeds, & crops, to divide friends & married couples; further, if a husband desires, a talisman may be made to mildly chastise his wife. Also, talismans to curse one's enemies during their travels, to divide companions, and to free a prisoner from his bondage
Lesser Key of Solomon:
AGARES. - The Second Spirit is a Duke called Agreas, or Agares. He is under the Power of the East, and cometh up in the form of an old fair Man, riding upon a Crocodile, carrying a Goshawk upon his fist, and yet mild in appearance. He maketh them to run that stand still and bringeth back runaways. He teaches all Languages or Tongues presently. He hath power also to destroy Dignities both Spiritual and Temporal and causeth Earthquakes. He was of the Order of Virtues. He hath under his government 31 Legions of Spirits. And this is his Seal or Character which thou shalt wear as a Lamen before thee.
The idea is that deities, jinns, angels, or demons can be summoned to the temple and they can provide knowledge, help, blessings, or magick skills.
Dwarfs can create magick engravings or tattoos, where is engraved a magick sigil (a type of pictorial signature of a deity or spirit) on the item depending on the engraving the dwarf can get an effect. For example, Dwarf 1 is angry with Dwarf 2, Dwarf 1 has magickal engraving skills, Dwarf 1 engraves an item to make Dwarf 2 have bad luck... Dwarf 2 constant drop items or some other fun effect.
So the idea is Magick works through items that are blessed by a magickal sigil, or rituals, or pact with the entity. In the case of a pact with an entity, the dwarfs need to give something that the entity likes on the altar.