Tim Krul was the hero as the substitute goalkeeper saved two penalties to send Holland through to the World Cup semi-finals.
Wesley Sneijder, who went close to breaking the deadlock eight minutes from the end of normal time with a curling free-kick, struck the bar in the dying stages of extra-time.
Striker Robin van Persie also went close in normal time but saw his shot hit the bar after deflecting off a defender on the goal-line.
Holland: Cillessen (Krul 120+1), De Vrij, Vlaar, Martins Indi (Huntelaar 106), Depay (Lens 76), Wijnaldum, Blind, Kuyt, Sneijder, Van Persie, Robben.
Subs: Vorm, De Jong, Janmaat, de Guzman, Verhaegh, Veltman, Kongolo, Clasie, Fer.
Booked: Martins Indi, Huntelaar.
Costa Rica: Navas, Gamboa (Myrie 78), Acosta, Diaz, Gonzalez, Ruiz, Borges, Tejeda (Cubero 97), Bolanos, Campbell (Urena 66), Umana.
Subs: Pemberton, Duarte, Barrantes, Francis, Granados, Brenes, Miller, Calvo, Cambronero.
Booked: Diaz, Umana, Gonzalez, Acosta.
Referee: Ravshan Irmatov (Uzbekistan)