The game is Pop-Up Pirate (also called Pop-Up Pirate Game or Pirate Pop).
If it had a visible timer counting down, it might be a variant like Pop-Up Pirate: Race Against Time or a similar "pop-up" game (e.g., Pop the Pig—burgers, not pegs). But the classic peg-insertion pop-up is Pop-Up Pirate!