The wing venation, patterned eyes, and even the horns on the scutellum suggest this is a soldier fly in the family Stratiomyidae. Many soldier flies bear a resemblance to wasps. This one kind of reminds me of a yellowjacket.
Reference:
Diptera of Costa Rica and the New World tropics