The D810 is a beast of a camera from it’s huge (no longer leading) megapixel count to it’s amazing dynamic range. It also goes down to ISO 64 natively which gives it even cleaner files and a slight advantage shooting at wide apertures in bright daylight or studios.
The 5D mark IV was a controversial camera when it was released, getting pretty harsh criticism mostly for its lack of video features most were hoping for. Objectively speaking, it’s quite a solid camera though, especially for stills photography. While the dynamic range isn’t QUITE on par with the D810 at base ISO (of 100, not 64), the 5D mark IV holds on to its amazing image quality well up into the higher ISOs where the D810 will soon fall apart.
In terms of sharpness, the higher megapixel (36 vs 30) and AA filter-free D810 should technically take the prize, but I haven’t noticed a real difference in my use of the 5D mark IV. While test charts in highly controlled environments may say differently, I wanted to see how they stacked up to my own eyes in a normal photo.
I found an image I’d taken with my D810 and the 105 f2.8 micro Nikkor, and reproduced it under the same lighting conditions with my 5D mark IV and 100mm f2.8L Macro. They’re not perfectly identical, especially because the D810 was shot at ISO 64 which the Canon can’t do, but I got them as close as I could and for me personally it’s close enough for a real life comparison. I processed them both nearly identically in Capture One Pro (some slight differences in exposure adjustments due to how the D810 and 5D seem to capture shadows and highlights differently) with no sharpening applied. These are the results:

5D mark IV

5D mark IV 100% crop

D810

D810 100% crop
Click the link below to download the full resolution files for yourself but I see no meaningful difference. I was actually legitimately surprised.
I really think that the lenses you put in front of these cameras will have a much more dramatic effect on their sharpness (as well as other qualities) and the larger resolution/lack of an AA filter should not drive you to go for the D810 over the 5D mark IV.
Of course, there’s a LOOONNGG list of other things that could drive you one way or the other, but for now we’ll just look at this one point.
Check out these cameras and lenses below! They’re affiliate links so if you decide to make a purchase through one of these links I will receive a percentage of the sale, but it won’t cost you anything extra.
Canon 5D Mark IV: http://amzn.to/2jaYiyj
Canon 100mm f2.8L Macro: http://amzn.to/2kaRhNy
Nikon D810: http://amzn.to/2kAifi6
Micro-Nikkor 105mm f2.8g: http://amzn.to/2k9IJpE