At a high level, we know that a zksnark can be created so that it proves that a publicly known output $z$ is the result of applying a publicly known function $\text{f}$ to a sef of private (i.e., secret) inputs $x_1, x_2, ...$, namely $z= \text{f}(x_1,x_2,...)$.
Under the hood, what the zksnark is actually doing is prove a set of constraints (each constraint is a simple arithmetic statement that is true or false), so that the full set of constraints is true if and only if the public output is correctly calculated from the private input.
So the machinery of the zksnark (e.g., a zksnark circuit compiler such as Circom) makes it simple for us to add additional constraints that implement the desired logic of the full problem to be solved. Here, we want to also prove that the secret $S$ hashes to a publicly known value for the hash of the secret, $H = \text{Hash}(S)$. For example, maybe $S$ is the private key for a blockchain wallet, $H$ is the publicly known wallet address owned by that private key, and $\text{Hash}$ is the method to compute the wallet address from the private key.
So the zksnark should have a system of constraints that implement the following:
$$H - \text{Hash}(S) == 0 \\
\text{encryptedSecret} - \text{f}(S, \text{salt}) == 0 $$
Here, the function $f$ is the encryption function that encrypts the secret using Bob's public key, and $\text{salt}$ is the salt/nullifier that could be optionally included to prevent replay attacks, double spends, etc.
In a possible implementation, $\text{f}$ and $\text{Hash}$ are published functions, $H$ is a public input to the zksnark and is known to be the correct hash of the secret $S$, $S$ and $\text{salt}$ are private inputs to the zksnark, and $\text{encryptedSecret}$ is the public output of the zksnark. The zksnark is configured to prove that the constraints above are satisfied, which means that Alice knows a secret $S$ and a $\text{salt}$ which satisfy the constraints and produce the encrypted output $\text{encryptedSecret}$.
Victor the verifier can then run the standard verifier algorithm for the zksnark, to verify that the full logic has been satisfied.
(Note: the original question had a typo in "Alice wants to share a secret with Bob so she encrypts it with Bob's private key", as it should say "encrypts it with Bob's public key".)