Klaas-Jan Huntelaar and Wesley Sneijder scored late goals Sunday to give the Netherlands a 2-1 victory over Mexico and a spot in the World Cup quarterfinals. Huntelaar, who came on as a 76th-minute substitute, scored the winning goal from the penalty spot deep in injury time after Rafael Marquez brought down Arjen Robben in the area.

“You don’t know when your chance will come, but it was today, and so you grab it with both hands,” said Huntelaar, who was making his first appearance at this year’s World Cup. “And it was fantastic.”

Giovani Dos Santos gave the Mexicans the lead in the 48th minute, but Sneijder equalized for the Dutch in the 88th. It was the first time Sneijder, who scored five goals at the last World Cup in South Africa, has found the net in Brazil.

Robben has already scored three goals for the Dutch at this year’s tournament, but after earning the late penalty, he handed the ball to Huntelaar. “Klaas is a great penalty taker. He was fresh, had just come on and I had faith in him,” Robben said. “I asked him if he wanted to take it and he was very sure of himself.”

Huntelaar and Sneijder scored the goals at the hot and steamy Arena Castelao, but it was Netherlands coach Louis van Gaal that may just deserve the credit for making a crucial tactical change during the second of two official cooling breaks. As he did earlier against Australia, the master tactician again switched his team around in the second half, changing from the more defensive 5-3-2 system to the traditional Dutch attacking 4-3-3 formation.

“Yes, we escaped,” Van Gaal said. “But we showed that we could create more chances with 4-3-3, and the players handled this shift very well.”

Van Gaal said he made his critical switch during the second-half break, huddling with his players as they drank from bottles on the sideline. “I moved to ‘Plan B’ at the cooling break after (Mexico goalkeeper Guillermo) Ochoa made an amazing save,” said Van Gaal, soon to be the manager at Manchester United. “That is a good way to take advantage of those breaks.”

Ochoa had kept his team in the match with two great saves in the second half, but he was beaten by Sneijder’s powerful drive and guessed wrong when diving in an attempt to stop Huntelaar’s penalty.