Grave Pact reads: "Whenever a creature you control dies, each other player sacrifices a creature." A creature dying as part of paying a cost still counts as dying (going from the battlefield to the graveyard), so Grave Pact's trigger condition is met.
Under CR 700.4, to "sacrifice" a permanent means to move it from the battlefield to the graveyard as a game action. CR 118.12 confirms that costs can include sacrificing permanents. Importantly, the game does not distinguish why a creature died when checking triggered ability conditions — the creature simply died, and that is sufficient (CR 603.2).
The sacrifice happens as the cost is paid, before the spell or ability using that cost even begins to resolve. Grave Pact's triggered ability goes on the stack afterward, once the game checks for triggered abilities following the cost payment (CR 117.12, 603.3).
Example: You control a Llanowar Elves and activate Viscera Seer's ability, sacrificing Llanowar Elves as the cost. Llanowar Elves dies, Grave Pact triggers, and each opponent must sacrifice a creature — even though Llanowar Elves was sacrificed just to pay for an activated ability.
This applies equally to sacrifices made as part of spell costs, activated ability costs, and triggered ability costs. As long as a creature you control goes from the battlefield to the graveyard, Grave Pact will trigger.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.