Yes, that's the idea. It's not necessary to cast p_i to void * in the argument list.
A function that accepts void * argument will accept a pointer of any type.
BTW, a function call has no = sign in it.
my_function (stack, p_i);
However, there's no need to even allocate a pointer for this. You can simply pass the address of value.
my_function (stack, &value); // Address of value is a pointer
edit: Just saw your other thread and now understand why you're allocating an object of size_t, so disregard the last comment about not needing dynamic allocation.