Jamaica's Aaron Jones-Bishop scored his third try with two minutes left, but Jy-Mel Coleman missed the conversion that would have won the game.
Wales trailed at half-time with tries by Rhodri Lloyd and Courtney Davies going unconverted.
Davies took over the kicking and converted Lloyd White's try and kicked a penalty to edge Wales ahead 16-12 with six minutes remaining.
Wales squad: Elliot Kear, Rhys Williams, Dai Evans, Christiaan Roets, Courtney Davies, Gil Dudson, Lloyd White, Craig Kopczak, Rhodri Lloyd, Steve Parry, Joe Burke, Jake Emmitt, Anthony Walker, Andrew Gay, Matty Fozard, Morgan Evans, Ian Newbury, Connor Farrer, Ben Morris
Jamaica squad: Wayne Reittie, Richard Barnett, Alex Brown, Lewis Bowman, Aaron Jones-Bishop, Danny Thomas, Jy-Mel Coleman, Jode Sheriffe, Joel Farrell, Jordan Andrade, Mo Agoro, Danny Bravo, Corey Hanson, Ross Peltier, Jamel Goodhall, Keenen Tomlinson, Kadeem Williams, Josh Hill
Jamaica held Wales to a thrilling draw in a friendly in Wakefield.