Is there a way to filter publications by their grant information (say NSF grant ID)? We're working on building a tool to evaluate the efficacy of NSF proposals, broken down by topic. We extracted the topics per grant using this dataset. 

One of the criteria for evaluating the impact of a grant could be the aggregating and analyzing publication-level citation-metrics, perhaps using this list of databases. 

However, there doesn't seem to be a way to filter papers that were wholly or partly funded by a particular grant. Do you have any suggestions about how this data could be retrieved, or how grant-giving bodies typically analyze this themselves?
Grant giving bodies typically rely on self-reporting: the progress reports submitted to them will typically include information about publications generated during the funding period. 

That said, one option is to check the OpenAIRE database. The OpenAIRE initiative aims to create a database of publications and research data, and as part of their design, asks the individuals who deposit the material for funding information. This certain does not encompass all funded projects (as it also depends on the researchers doing self-reporting), but does create a searchable database. (See, e.g. this link for a list of NSF funded proposals.) (Note, the OpenAIRE project was started by the EU and they currently have about twice as many items funded by the European Commission in their database as there are by the NSF.)