The France 98 champions and Germany 2006 beaten finalists enjoyed large chunks of possession but sterile finishing cost them dear until Valbuena produced the late winner.
Coach Raymond Domenech elected to start Arsenal central defender William Gallas and Chelsea striker Nicolas Anelka, at the expense of Thierry Henry, with Steve Mandanda replacing number one keeper Hugo Lloris in goal. For Gallas this warm-up represented a searching test of his recovery from a calf injury that has kept him sidelined since March.
In Henry's absence the captain's armband was worn by Manchester United defender Patrice Evra. Franck Ribery, suspended for his club Bayern Munich's Champions League final defeat to Inter Milan last weekend, also figured in Domenech's starting XI.
Domenech, who will step down after a roller-coaster spell as manager of France after the World Cup, was booed by some sections of the fans when his name was announced before kick-off in his last game in charge of Les Bleus on French soil.
Surprise lead for the Ticos
Costa Rica, who missed out on a trip to South Africa after losing their two-leg play-off against Uruguay 2-1 last November, went into a surprise 12th minute lead. The Central Americans had their more illustrious hosts on the backfoot when midfielder Carlos Hernandez let fly from 25 metres, his shot bouncing over Mandanda's outstretched hands.
France, who thought they had equalised four minutes later only for Yoann Gourcuff's tap-in to be ruled offside, did deservedly draw back level in the 23rd minute when Jeremy Toulalan set up Ribery, whose shot from the left hand side of the box was deflected for an own goal by Douglas Sequeira past goalkeeper Keylor Navas.
Mandanda may have been caught napping for Costa Rica's opener but he made amends when later tipping a goalbound shot from Bryan Ruiz, who plays his club football with Dutch champions FC Twente, over the bar.
Domenech made three changes at the start of the second half - introducing Henry for Anelka, Alou Diarra for Toulalan and Sebastien Squillaci for Gallas. There was a moment of concern for the lively Ribery after the hour mark when he crumbled to the floor clutching his right ankle after an over zealous tackle by Pablo Barrantes. After watching Ribery rise unscathed Domenech then replaced Sydney Govou with Marseille winger Valbuena, and he had the Costa Rican defence in a panic with his very first touch of the ball.
The pocket-sized player then ensured he would remember his first run out for his country for years to come when he bagged France's winner, a right footed hammerblow after being set up by late substitute Abou Diaby, with seven minutes left.
Domenech praised the desire and motivation displayed by his side. "That's what we want to see all the time. At least they are trying things, and want to achieve something. They know it's this group of 23 that are going [to South Africa]. They know they'll be doing it together. They have confidence in each other ... but this was only a warm-up, the World Cup only begins on June 11."
France's remaining warm-up fixtures before the World Cup are an away date against Tunisia on 30 May and against China in Reunion on 4 June. They open their World Cup campaign against Uruguay on 11 June.