Sounds like the script isn't running with the group membership you think it is. From within the CGI script, try printing out the value of the variable
$( to see what groups the CGI script is running as a member of.
Also, you will probably have to restart the Web server after changing group membership, if you haven't done that already.