That's why I always make a backup savefile on the last day of year. The dwarves die of old age when the new year begins, but this is decided before the new year begins, so I can reload the game knowing who will die - and memorize his family, friends, and most importantly his job assignments.
BTW I haven't seen a vampire dwarf in fortress mode or a ghost in v0.40.x, but I have some dwarves dead because of old age and I expect more to follow soon. My queen is close to 170 and I'm yet to decide if I let her realize her dream of immortality or allow her son to take his heritage.
And to answer the original question - the World Viewer for Legends and similar programs still work (mostly) and they can help with that.
Or, since you use dfhack:
1. enter lua (by typing "lua" in console)
2. go to units screen and select your dead dwarf
3. type in console unit = dfhack.gui.getSelectedUnit()
4. type in console ~unit.counters
This will print a number of items, including death_id. It can also have death_cause, but most probably it will be "-1", so no use. Say that death_id it is 1234 for example.
5. type in console ~df.global.world.incidents.all[1234]
where instead of 1234 you enter death_id number from #4.
This will show some more data, including killer id and death_cause. Or you can enter ~df.global.world.incidents.all[1234].death_cause
straight away to get death_id number only, if you are overwhelmed by all this useless information. Some common ids:
0 = old age, aka died peacefully
1 = hunger (starved)
2 = thirst (not enough drinks)
3 = shot
4 = bled to death
5 = drowned
6 = air (suffocated, including when died because lungs were damaged by your military or by a syndrome)
7 = struck down (most of kills by melee military classifies here actually, even though some victims may be described as "slaughtered" on the slab)
8 = scuttled (I've seen this only for wagons)
9 = obstacle (like from a fall or when thrown by a Forgotten Beast)
10 = lava (aka magma)
11 = lava mist (aka magma mist)
12 = dragonfire
15 = cavein
16 = crushed by a bridge
19 = cage blasted (I've seen this on a gobbo who died in a cage, so may not always involve minecart cannons)
21 = trap
43 = succumbed to infection
45 = scared to death
48 = blood drained (when vampires hunger was higher than blood count of a victim this happens)
50 = vehicle (fell under a train)
51 = flying object (or falling object, though caveins and falling rocks have their own ID)