How can I dedupe only those leads and contacts from specific campaigns?
The problem is finding the leads or contacts that match a specific campaign is that there is no specific field on the lead or contact object that tells you if the object belongs to a campaign.
In order to do this you would have to export your CampaignMember objects that match the specific CampaignID that you are concerned about. The export will contain the ContactID (or LeadID) for those included in the campaign. Create a custom field on your lead or contact object in Salesforce to flag the record as belonging to that campaign. You can set the value of this flag using MassEffect, matching on Contact/Lead ID.
Once you have the custom field populated you can use conditions in STD to select only those Leads or Contacts where the flag is "true".