So just to make sure: the walk-in pantry is implemented as a room connected to the kitchen, and you want the game to assume the player wants to go back into the kitchen when they try to set something on the counter (since the counter is actually in the kitchen).
I believe you want to handle this as a two-parter. First, you need to put the counter "in scope" from the pantry, which means that you can see it from there (otherwise, Inform assumes rooms are basically opaque boxes, which is why you're getting the "can't see any such thing" message). You can learn about scope in chapter 17.27, and here's the gist of what you'll want to do:
Code:
After deciding the scope of the player when the player is in the Pantry:
[tab]place the counter in scope.
Second, you want to tell the game to let the player try going back to the kitchen before dropping something on the counter. It's nicest to do this with a "try [action]" phrase, because if the player can't go back to the kitchen for some other reason (pantry monsters have glued her feet to the floor, maybe?), your rule won't artificially override that. So you can do that like this:
Code:
Before putting anything on the counter when player is in Pantry:
[tab]try going to the Kitchen;
[tab]continue the action.
You may also be interested in "try silently," in chapter 7.4.
If I've misread the situation and the intent is that there's a counter that's reachable from the pantry (as in, it's within arm's reach), you should check out chapter 12.16, on reaching inside and reaching outside rules.