The Black Cats had looked set for another nail to be hammered into their coffin until Fabio Borini scored in the 91st minute to earn his side their first point in almost a month.
Goals from Andre Ayew and James Collins either side of a freak Wahbi Khazri strike had put the visitors on course for a second consecutive win before Sunderland's equaliser, although the Black Cats remain rooted to the bottom of the table and nine points from safety.
Sunderland went into the match having failed to even score in their last seven outings, and it looked like being another long afternoon for beleaguered manager David Moyes when his side fell behind inside five minutes.
Andy Carroll's mis-hit volley from a deep cross towards the back post proved to be a perfect pass into the path of his strike partner Ayew, who kept his composure to stroke the ball into the bottom corner from close range.
Sunderland's drought finally ended in the 26th minute, though, as a three-month wait for a home Premier League goal came to an end in bizarre circumstances to level the scores.
Khazri, making his first league start since October, swung his corner into the middle and, with Randolph pinned back by Victor Anichebe on the line, the ball flew directly in for Sunderland's first goal in more than 700 minutes of action.
Having waited so long for one, the hosts almost got another just four minutes later when Billy Jones sent a low strike towards goal, but his effort skimmed narrowly wide of the target.
The scores remained level until half time but, just as they had in the first half, West Ham made a quick start following the interval and were back in front within three minutes of the restart.
Khazri then lashed a powerful free kick over the crossbar before the game was brought to a halt following an injury to Jones, who eventually left the field wearing a neck brace.
That stoppage resulted in the fourth official indicating a minimum of 10 added minutes, and Sunderland only needed one of those to grab an equaliser as Randolph could only spill the ball at the feet of Borini, who took a touch before drilling a low finish past the covering defenders on the line.
Hope of a dramatic turnaround which could perhaps have been the kickstart Sunderland need for an unlikely survival bid was given a boost in the fifth minute of stoppage time when Sam Byram was shown a second yellow card for a rash challenge on Adnan Januzaj.
However, the Black Cats were unable to make the most of their numerical advantage and settled for a point which leaves them with plenty of work still to do if they are to keep their hopes of another great escape alive.
Sunderland are now winless in eight matches and have not picked up a victory in nine home games since the turn of the year, whereas West Ham rise a place to 13th in the Premier League table courtesy of the point.