It was Slaven Bilic's side that majorly controlled the opening 45 minutes, with decent chances for Emmanuel Emenike and Andy Carroll, but couldn't find the breakthrough.
United perked up in the second period but managed to fall behind in the 68th minute to a terrific Dimitri Payet free-kick, however Martial managed to cancel out with seven minutes to play to set up a replay at the Boleyn Ground.
West Ham came into this Old Trafford clash on a run of fine form, and had three great chances to take the lead inside the opening 18 minutes.
The first came six minutes after Anthony Taylor's first whistle as Carroll weighted a perfect chipped ball into Emenike, who managed to beat the offside trap, but he dragged the effort wide of David De Gea's right-hand post.
Carroll then had an attempt of his own three minutes after been the provider as drove into the area to get on the end of Aaron Cresswell's great cross but the determined effort wasn't rewarded as he headed over.
Emenike had the perfect opportunity to give Bilic's side the lead as Payet laid it off for Cresswell whose chipped effort was found by the Nigerian, yet the shot was comfortable for De Gea as it was straight into his chest.
United broke straight up field from that wasted opportunity as Ander Herrera found space at the back post but his attempted volley was just wide of the post.
Louis Van Gaal's side looked shaky as the second half got underway with Michail Antonio testing De Gea just after the restart but looked to be on the rise until the 68th minute.
Payet hadn't really been involved up until that point bar a few passes here and there, but he looked to make a significant difference as he stood over the set piece 30 yards out.
The ex-Marseille man had already scored some great free-kicks but this was arguably the best of the lot as his strike had De Gea running across, the Spaniard had no chance as it curled out of his reach to send Old Trafford into a stunned silence.
He looked certain to get his second and send the Hammers to Wembley in the 77th minute as the ball deflected into the path of the Frenchman who looked one-on-one with De Gea but Guillermo Varela did brilliantly to get back to intercept.
Martial to the rescue
United had failed to really register a significant shot on goal in the opening 83 minutes and they looked destined to bow out of the cup for another season until Martial saved his side once again.
Jesse Lingard did well to slip the ball through to Herrera with the Spaniard playing a dangerous ball into the back post and Martial did well to stretch out his leg to hook the ball into the net, much to the relief of the Old Trafford collective.
Van Gaal's side nearly threw it all away as the match entered stoppage time as West Ham had two great chances to snatch the win.
The first came in the first minute of added time as Antonio had a punt with a low, drilled effort towards De Gea's goal but the 'keeper did brilliantly to tip it wide.
Hammers fans thought they had done it the dying seconds as the away side had the ball in the back of the net but celebrations were short lived as the offside flag was raised and with that the replay was sealed.