DS carts have a variety of functions that will need to be taken care of. Some devices use standard protocols (360 NAND but substituted for XD memory, CF cards being IDE by any other name, any number of controller standards over the years....) but not the DS and its DS slot does not act with much of a standard protocol*.
You can program a chip to act as a middleman but at this point you are reinventing a flash cart, many of which have already been made and had years of work poured into them.
*technically the save uses SPI (
http://problemkaputt.de/gbatek.htm#dscartridgebackup ) and SD cards do speak SPI (
https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial/look-out ). There was a family of mods way back called the passme2 which used the save of the DS slot device to launch custom code (I imagine you in turn could mod the firmware of the DS to do this rather than do an exploit). For the effort again flash carts are things which are readily available, and for most of what you are going to do with this SPI affair then you could probably get away with the wifi delivered homebrew -- if you can flash your DS with flashme then you can send whatever you like without hassle, if not there is a new exploit for it
https://gbatemp.net/threads/haxxstation-ds-download-station-exploit.473648/ .
Short version. Buy a flash cart.