To have Pi-hole read custom configuration files under /etc/dnsmasq.d/, you need to enable misc.etc_dnsmasq, see Custom dnsmasq configs not loading.
For single configuration lines, you could also manage them via Pi-hole's UI directly by adding misc.dnsmasq_lines, e.g. similar to How to set TTL for Local DNS records? - #2 by Bucking_Horn.