What is the S-Bahn station?
Most, but not all, of the S-Bahn stations are within the inner zone (Innenraum) of the MVV system. So is Nymphenburg. If you are within the inner zone, and will stay within the inner zone on your way to Nymphenburg palace, all you need is an Innenraum ticket (ticket for the inner zone). A single trip ticket is 2,80€; 5,60€ for a round trip. If you will be doing any more traveling in the inner zone that day, then an Innenraum Tageskarte (day pass) for 6,60€ would be justified. For two people, a single trip ticket is 5,60€, round trip tickets would be 11,20€, and a Tageskarte would be 12,60€.
One way would be to take the S-Bahn to the Hbf, then catch the #17 streetcar on the street north of the station.
You could also take the S-Bahn to the Laim station and the #51 bus from there to Nymphenburg.