The former United defender feels that it would be in club's best interest to replace van Gaal in the summer but only if they can ensure at least a fourth-placed finish.
Bayern Munich manager Guardiola and former Real Madrid boss Ancelotti have both been touted as possible candidates for the job at Old Trafford once van Gaal departs his post.
"The board and owners might want to be loyal to Van Gaal after investing so much in him but they also have to do what is best for United.
"And if United finish outside the top four, that will be catastrophic.
"It might rule out the chance of getting either Guardiola or Ancelotti.
"It will be more difficult to attract the best players, too. The next six months are absolutely crucial."