The attacking midfielder stepped up on the stroke of regulation time to curl a magnificent free-kick past Cameroon goalkeeper Fabrice Ondoa.
France opened the scoring through Paris Saint-Germain's Blaise Matuidi before Cameroon immediately drew level thanks to Porto striker Vincent Aboubakar.
Arsenal striker Olivier Giroud handed the home side the lead again just before half-time, Eric Choupo Moting equalising before Payet's cherry on the cake.
"There are things we can improve but it was our first match after a long period without competition for some players," said France coach Didier Deschamps.
More From This Section
"Cameroon played in a new system with power and speed in midfield and up front," said Deschamps, adding: "I wasn't expecting perfection, but the spirit is there."
Cameroon coach Hugo Broos said: "For me the score is 2-2 because we were only beaten by a magnificent free kick by Dimitri Payet, a real talent.
"The players can be proud of their performance. I hope we keep this same spirit against Mauritania (African Cup of Nations qualifier)."
Afforded far too much space, Toko Ekambi cut back in midfield from the left wing and stroked a shot to the right of the goal.
Hugo Lloris, captaining France for the 50th time, with only current coach Didier Deschamps having notched up more games with the skipper's armband (54), just turned the shot around his post with a fine full-length save.
Cameroon hit straight back, however, Aboubakar producing a great finish off a pinpoint cross from Allan Nyom after some slack defence from the restart.
Nyom's sliding tackle deflected a dangerous-looking opportunity for Matuidi, but the pressure finally told when Giroud pounced on a Pogba cross, side-footing it past the wrong-footed 'keeper Fabrice Ondoa.
Cameroon's Aurelien Chedjou was given too much space down the right flank early in the second period, the Galatasaray defender's hard cross-goal shot cleared by a covering Giroud.
Ondoa was on hand to keep Giroud out as play shot back up the other end of the pitch after a defensive, retreating blunder by Chedjou.
N'Golo Nante, one of Leicester City's stand-out performers as they marched to a shock English Premier League title, fired in a shot that went just wide of the Cameroon post after Ondoa had produced another goal-saving lunge at a close-range Pogba effort.
His resulting goalkick beat everyone before being grounded by Mohammed Djetei and centred for the unmarked Choupo Moting, who made no mistake past Lloris.
But the game was not over, Payet stepping up to curl in a magnificent free-kick past Ondoa. France, who play Scotland in Metz on June 4 in their final warm-up match, open their Euro campaign against Romania on June 10.