I flew into the US and left by land a few months ago so there was no US departure record for me that time. I wanted an entry stamp into Mexico as evidence I hadn't overstayed in case I didn't return to the US before the I-94 expired, so I just went into the immigration office, asked for a stamp and got the stamp. I don't know if it would be so straightforward for foreigners but it might be. Google "Instituto Nacional de Migración" (INM) so you can see the office logo you have to look for.