How do the pins of this analogue switch correspond in this diagram?
You will need the DG419 SPDT switch. The DG417 is an SPST switch, which won't do for your application.

For the DG419, D (pin 1) would be your output. S1 (pin 2) is connected to D when IN (pin 6) is Low.  S2  (pin 8) is connected to D when IN is High.