Now, coach Stephen van Huizen's men must win in the semi-final on Saturday to claim a ticket to the World League Semifinals either in South Africa or London.
Only the top-two teams in Dhaka will make the trip to either London or South Africa for a shot at the 2018 World Cup in India.
Rosli Ramadan scored a ninth minute field goal, but Sri Lanka equalised in the 15th minute off K. Nalantha.
But World No 13 Malaysia were in no mood to lose, and went on to score off Tengku Ahmad Tajuddin (18th), Rosli Ramadan (22nd), Aiman Nik Rozemi (23rd), Rashid Baharom (29th)
The other Sri Lanka goal was scored by D. Ishanka in the 27th minute.
There seemed to be an ugly incident in the game when Sri Lanka player Samida de Costha was flashed the red card for hitting Joel van Huizen on the head in what appeared to be an off the ball incident in the third quarter.
However, after the Technical Officials viewed a video of the incident, they saw Joel falling down on his own and de Costha was not involved in the incident.
The red card was revoked, and De Costha can play in the next match.
SATURDAY: Semi-finals: Malaysia v Egypt (3.45pm), China v Oman (6pm).
Note: Malaysian time.