The 31-time MotoGP race winner will make his second competitive start for KTM since joining the Austrian manufacturer as a test rider in 2019, having retired from full-time competition the season before.
Along with Mika Kallio, the Spaniard has led the KTM test team with the development of the RC16 and will compete alongside factory riders Brad Binder and new signing Jack Miller at Jerez on 28-30 April.
Pedrosa's debut grand prix start for KTM was eventful as he was involved in a clash with Aprilia test rider Lorenzo Savadori in the 2021 Styrian GP, when the Italian rode into Pedrosa's stricken motorcycle unsighted and it ignited into a huge fireball.
The race was red-flagged but Pedrosa was able to make the restart and finished in 10th place.
Hoping for a smoother outcome to Pedrosa's last MotoGP start, KTM team manager Francesco Guidotti said: "It's fantastic news that Dani wants to refresh himself with MotoGP this season and Jerez makes good sense as it's a popular place for us to test and, also, he knows the place very well.
"It will be an ideal opportunity for him to get more information for the future development of our race bike and we look forward to having him with us in the pitbox."
"Dani is a strong guy with a strong mentality and we always said when he wanted to do a wildcard then we'd be happy to make that happen," added Pit Beirer, KTM motorsports director.
"The perfect 'test' is always a race situation. If we can work on future development parts then it is super-important and I'm very happy that Dani will race again."
Earlier on Thursday, the factory KTM squad launched its 2023 MotoGP team and updated livery alongside Binder and Miller, the latter joining from Ducati on a two-year deal.
The Austrian manufacturer has been utilising a partnership with the Red Bull Formula 1 squad at its base in Milton Keynes to develop the aerodynamic package of the RC16 MotoGP bike, as part of its plan to climb the MotoGP pecking order after finishing fourth in the world constructors' championship last year.