The deal is yet to be completed but it will also involve a cash payment from the Spanish giants, taking the overall value to 40m euros (£29m).
De Gea, 24, has been linked with a move to Real throughout the summer.
United manager Louis van Gaal opted not to pick him until the uncertainty over his future had been resolved.
De Gea's contract is due to expire in 2016 and United had previously indicated they wanted a world-record fee for a goalkeeper, or defender Sergio Ramos in exchange for De Gea.
Instead they will get 28-year-old Navas, who was Costa Rica's goalkeeper at last year's World Cup.
source :bbc