With Senegal missing injured star man Sadio Mane and the Dutch without their main attacking threat Memphis Depay at kick-off, the Group A encounter in Doha looked set to end in a goalless draw.
But with just six minutes remaining PSV Eindhoven forward Gakpo got up in front of Senegal goalkeeper Edouard Mendy to head in a floated Frenkie de Jong cross from the left.
Substitute Klaassen then secured the victory deep in injury time, following up to score after Mendy had saved from Depay, who had also come off the bench.
"I always had the feeling we were going to score a goal," said Van Gaal, who is in his third spell as coach of the national team.
"It was an efficient win but I also thought we were fitter because every two minutes the Senegalese were lying on the ground.
The result leaves the Netherlands level at the top of the group with Ecuador, who beat hosts Qatar 2-0 in the tournament's opening match on Sunday.
Senegal saw Bayern Munich superstar Mane -- who came second in this year's Ballon d'Or -- pull out of the squad with a leg injury on the eve of the tournament.
"I don't think the scoreline is a fair reflection of the game and I am really proud of my boys," insisted Senegal coach Aliou Cisse, who saw both Abdou Diallo and Cheikhou Kouyate come off hurt in the second half.
Everton midfielder Idrissa Gana Gueye came closest to scoring for Senegal with a strike on the half-volley from the edge of the box that was beaten away by Netherlands goalkeeper Andries Noppert in the 73rd minute.
Van Gaal's side play Ecuador on Friday, while Senegal now face a must-win contest against Qatar.