Google's John Mueller said in a Google Webmaster Help thread said that if you have bad or spammy links pointing to 404 pages, it should have no negative impact on your overall site's rankings.
John said not only should it not happen, he has never seen it happen. He said:
To be clear, I have never seen a case where bad links pointing to URLs that return 404 have ever caused a website any noticeable problem in web-search. 404s are a part of the internet, they're expected to be seen when a non-existent URL is crawled, there's no reason that I can think of where it would make sense to count 404s against a site.
What if you do find a case? Then John says, let him know.
That said, if you ever feel that you've run across a case where it is really causing a problem, I'd love to take a look at the details. Feel free to send me a note directly on my Google+ profile ( http://johnmu.com/+ ) with the details that you've found. In this particular case (assuming you mean the site mentioned in the original post), those 404s are really not having any negative effect, and any changes in ranking that you're seeing definitely have other causes.
I don't get why a link to a dead URL would have any positive or negative impact anyway, but I guess anything is possible.
Forum discussion at Google Webmaster Help.
Image credit to ShutterStock.