The Hammers had been cruising at the interval after Carlton Cole's header earned them a deserved lead and Fulham had South African midfielder Kagisho Digikao sent off on his full debut. But the Cottagers hit back immediately after the interval with a penalty from Danny Murphy before Zoltan Gera's 57th-minute volley put them ahead.
West Ham had lost all composure and appeared set for their fourth consecutive defeat before Stanislas worked space in the Fulham box and his shot deflected in off Aaron Hughes.
Gianfranco Zola's men went ahead when Alessandro Diamanti's vicious free-kick allowed Cole to bury his header past Mark Schwarzer at the near post.
Fulham were reduced to 10 men when Dikgacoi was sent off for an off-the-ball clash with Scott Parker.
Chris Baird came on for Andrew Johnson to shore up the midfield and within 30 seconds of half-time Fulham were level as Diomansy Kamara bustled into the area and was brought down by Matthew Upson. Murphy beat Robert Green from the penalty spot and West Ham began to lose their composure.
Green reacted smartly to block Paul Konchesky's low free-kick but, from the resulting corner, Gera emerged unmarked at the far post to put Fulham ahead with a cool, side-footed finish.
Zola made two changes just after the hour mark, with Parker replaced by Valon Behrami and Stanislas introduced for Zavon Hines.
Behrami brought urgency to West Ham but Diamanti resorted to shooting on sight and Stanislas opted for a speculative drive from distance that flew over the bar.
West Ham finally found the breakthrough two minutes into added time when Stanislas worked space inside the Fulham box and saw his shot deflected past Schwarzer.