This may NOT be the best idea, but isn't it safer to use a web interface than doing this using sqlite3 commands, example here?
By adding the user www-data to the group pihole, setting the permissions on /etc/pihole to 775 and the permission on /etc/pihole/pihole-FTL.db to 664, It worked, after restarting the lighttpd service.
NOT sure I understand the concept of sudoers, www-data already has an entry in /etc/sudoers.d/pihole. I was wondering if this couldn't be achieved, using a sudoers entry?