Under-pressure Poland coach Pawel Janas saw his side come good in this final Group A game but whether it will keep him in a job remains to be seen.
Certainly, his showed plenty of fighting spirit after Ronald Gomez had opened the scoring.
The Poles also found an unlikely hero in defender Bartosz Bosacki, who scored both goals - his first for his country.
Both sides had only pride left to play for in sweltering conditions with the temperature posted at 28C in the stadium.
Costa Rica were the first to show and Paulo Wanchope tried a shot from distance after five minutes but his effort bounced into the arms of Artur Boruc.
Gomez decided to try his luck from 35 yards in the eighth minute with a free-kick but he saw it cannon off defender Bosacki and to safety.
The majority of fans in the ground were Polish but they saw their team struggle early on.
Defeats by Ecuador and Germany which had led to calls for coach Janas to resign seemed to have eaten away at their confidence.
Maciej Zurawski tried an ambitious free-kick from an acute angle in the 17th minute but it failed to trouble goalkeeper Jose Porras.
Costa Rica took the lead after 24 minutes when Gomez drove a free-kick through the wall and past Boruc after Wanchope had been brought down on the edge of the area.
Poland hit back and Ebi Smolarek picked out Ireneusz Jelen after 30 minutes but Porras was able to save comfortably.
Wanchope then scuffed a shot before Poland equalised in the 33rd minute when Bosacki scored from close range with goalkeeper Porras hopelessly positioned.
It was just the boost Poland wanted and Zurawski raced forward in the 43rd minute only for his effort to be blocked by Gabriel Badilla.
Porras then did well to turn away a free-kick from Jacek Krzynowek in stoppage time.
Poland started at pace in the second half and Jelen whipped a shot wide in the 47th minute.
They continued to look good on the counter attack and Smolarek tested Porras five minutes later.
Wanchope, though, was causing the Poles problems with his quick-thinking and movement.
Krzynowek saw his shot diverted by Porras and from the resulting corner Bosacki powered home a header in the 66th minute to leave Costa Rica stunned.
Wanchope thought he had equalised in the 82nd minute only for his effort to be ruled out for an infringement.
So Poland at least go home with a victory while Costa Rica have been left to reflect on what might have been.