The 22-year-old struck 17 minutes from the end as Raul Gonzalez Triana's side qualified from Group C as one of the best third-placed teams.
© Getty Images
However, Leones del Caribe, who also reached the last eight in 2013 - their best-ever Gold Cup finish - had to ride their luck in the early stages in North Carolina.
They threatened again on 13 minutes but, after a neat one-two between Ruiz and Marco Pappa, the latter could only fire into the arms of goalkeeper Disovelis Guerra.
The sides seemed poised to head into the break level, but Reyes had an opportunity to snatch a half-time lead although, instead of shooting, cut back for a teammate and the chance petered out.
A fast and furious start to the second period saw both outfits go close, with Ruiz smashing a half-volley narrowly wide on 48 minutes, before Martinez headed over the bar shortly after.
However, the deadlock was broken on 73 minutes when Reyes atoned for his earlier gaffe by heading home from close range for Cuba's first goal in the campaign.
Ruiz had the ball inside the net five minutes later, but it was ruled out for offside as Cuba held on to book their spot in the last eight.