If an ability I control is on top of the stack, can I cast an instant before it resolves? For example, I have Sarkhan the Masterless and a dragon on the board. An opponent attacks, triggering 1 damage from the dragon to the attacker. Can I cast Alchemist's Gift to give my dragon deathtouch before that damage resolves, or would I have to have given it deathtouch before the opponent declared attackers?
Yes this works the way you're hoping.
If Alchemist's Gift resolves and then the dragon is killed, the ability on the stack will also retain the deathtouch due to the "last known information" rule (113.7a in the MtG Comprehensive Rules as of February 2021):
Once activated or triggered, an ability exists on the stack independently of its source. Destruction or removal of the source after that time won’t affect the ability. Note that some abilities cause a source to do something (for example, “Prodigal Pyromancer deals 1 damage to any target”) rather than the ability doing anything directly. In these cases, any activated or triggered ability that references information about the source for use while announcing an activated ability or putting a triggered ability on the stack checks that information when the ability is put onto the stack. Otherwise, it will check that information when it resolves. In both instances, if the source is no longer in the zone it’s expected to be in at that time, its last known information is used. The source can still perform the action even though it no longer exists.
Notably, since some people tend to wait if something happens: OP would have to annouce the trigger and then keep priority and cast the spell immediately.– ErikMar 12, 2021 at 8:24
2@Erik Which is to say, after declaring the trigger (and putting it on the stack), they do not have the opportunity to ask their opponent whether they want to play anything (hoping they might waste a card or some mana boosting the attacking creature). If the opponent passes, it is too late to play the Gift as the triggered ability will resolve.– ArthurMar 12, 2021 at 12:38
I don't think you need to hold priority in OP's example since as the NAP the attacker will have to pass priority to you before the trigger resolves, during which period you can cast Alchemist's Gift.– JQLMar 15, 2021 at 4:38