Grep treats all lines independently, so it can't do the job on its own.
Awk is a general text processing tool. Keep track of what the current package is (in the variable p), and output a match if a requires: line is found in the right package (removing the requires: prefix).
<setup.ini awk -vpackage='NAME_OF_PACKAGE' '
sub(/^@ */,"") {p=$0}
p==package && sub(/^requires: */,"") {print}
'
Another awk approach is to process input delimited by newline-@ sequences rather than newlines. Or, since package sections have a blank line between them, process input by paragraph: pass an empty string as the record separator RS (which means that records are separated by one or more blank line). Then, for each line in the sought-after record, if the line begins with requires:, print it (minus the prefix).
<setup.ini awk -vpackage='NAME_OF_PACKAGE' -vRS= -vFS='\n' '
sub(/^@ */,"") && $1==package {
for (i=2; i<NF; i++) {if (sub(/^requires: */,"",$i)) print $i}
}'
Another possibility is Perl's paragraph mode (-00). If the paragraph starts with the right header (/REGEXP/m means a multiline match, so that the $ anchor means end-of-line rather than end-of-string), and it contains a requires: line, then print that line (minus the prefix).
<setup.ini package=NAME_OF_PACKAGE perl -00 -ne '
/\A@ *$ENV{package}$/m and /^requires: *(.*)$/m and print "$1\n"'
And here's one for the (GNU) sed lovers . (You are not expected to understand this.)
sed -ne '/^@/ { h; b; }; G; s/^requires: *\(.*\)\n@ *NAME_OF_PACKAGE$/\1/p'