The 20-year-old pulled up while warming up for Saturday's 1-0 win at Norwich City that closed the gap between fifth-placed United and fourth-placed Manchester City to two points, with Van Gaal's men having a game in hand over their local rivals.
The French international has enjoyed a solid start to his United career since signing from Monaco in September, scoring 15 goals in all competitions, and his absence will be a blow for a side that can ensure a top-four finish if they win their last two games.
"If his muscles are still tight I don't take any risks because he is a very important player. We don't want a rupture and that is very important for us," Van Gaal told a news conference.
"I cannot say (if Martial will play) because we have to wait."
Van Gaal also urged his side to focus on beating West Ham and ignore the feverish atmosphere at what will be the final game at the Boleyn Ground ahead of the Hammers' move to the Olympic Stadium next season.
"On Tuesday, we have to play against an opponent who says goodbye to the stadium so they don't want to lose," the Dutchman added. "It's not good for us and West Ham United are a very good team.
"We don't want to spoil their party but we need the three points. It is a big night and I think the players shall feel that also."
United end their season at home against Bournemouth on Sunday.