Both men will pilot the Red Bull RB7, which proved all-conquering in 2011, around a specially constructed course in the city's most famous and historic square, the Zocalo - home to the city's cathedral and also the ruins of the Aztec city of Tenochtitlan.
The demonstration takes place on June 27, just six days after this year's Grand Prix in Austria, and little more than four months before the Formula 1 Gran Premio de Mexico 2015 - the first F1 race to be held in Mexico since 1992 - which takes places on October 30 - November 1.
"I'm really looking forward to this very special trip to Mexico," Ricciardo said. "The demo runs in the city centre should be amazing and everyone is up for putting on a really big show.
"Mexico City's huge and I know that Mexican people are really into F1, so I'm looking forward to seeing just how big a crowd we can bring out on the day!"
The demonstration will kick off at 1000 local time in the Plaza de la Constitucion. Entry will be free.