In the professional world, this is by no means unheard of. Photojournalists do this for a living, and if they end up with a well-taken photo that has someone about to die, they'll still send it in, and it will often get published.
One example that comes to mind was from the photojournalist Eddie Adams, when he photographed the Execution of Nguyễn Văn Lém (Wikipedia link, but graphic picture if you look closely). Another, as posted in the comments on one of the answers, is The Falling Man, depicting a man falling from the Trade Center during the terrorist attack on 9/11.
Ethically, in a cultural sense, it's not wrong to do. Especially if the person cannot be easily identified, it's not an ethical problem. The only concern would be out of respect for the family if you chose not to publish it.
As far as personal/social media, I would treat it with caution. If this fits with the rest of your photos on Instagram (i.e., if you focus on pro/semi pro/amateur photography and the photo is well taken), I'd say go ahead. If it's going to take your audience by surprise, think twice about posting it. You could use it to make a point, but simply posting it on you IG filled with selfies, and saying "here's a pic of someone about to die" would be unprofessional at best and could cause issues.
The same advice would go for other social media venues (Facebook, careful about who on Snapchat).
According to this random website on the internet, It appears that legality can vary from country to country. In France, it appears to be illegal, while in the US or Uganda it does not appear to be against the law.
Medium: STOP! Read this before you post another RIP on social media