Matching gift functionality is built into the Nonprofit Success Pack. It allows you to track organizations that match gifts, gifts that are eligible for matching (eg. by the donor's employer), and to connect matching gifts to original gifts and give soft credit to the original donor.
To use this functionality, all organizations that give matching gifts must be entered as accounts in Salesforce. When eligible gifts are entered, they are linked to the matching organization. Then, when the matching gift comes in, it can be linked back to the original gift (or gifts) and credit can be applied.
For more details, including a step by step walk through, see the NPSP documentation here.