Philmate,
I really don't know anything about it, so sorry if you're way past this. But I think you have to include the ncx file in the ePub file (add it to the zip archive), include it in the manifest, "reference it in the spine toc attribute", and replace the content pages with your modified ones with anchors. Then you feed the modified ePub file to the command-line kindlegen program.
Note that the
wiki says "KindleGen version 1.2 does not generate an APNX file directly; it creates a PAGE section in the MobiPocket file which is then stripped and converted to an APNX file by Amazon's publishing service. The KindleGen input can use either a NCX pageList or page-map xml.
Kindle Previewer, as of version 1.5, does not display page numbers. In addition, Kindle for PC and Kindle for Mac, while they do display page numbers using .apnx files, are unable to read them from a MobiPocket file generated by KindleGen. This makes testing the page number feature somewhat problematic for publishers."