Based on the Weblio entries to these expressions, it seems to me that ほかに can be equated to "besides" and ほかは to "apart from".
Moreover the は is putting emphasis on the ほか, putting the focus on the other thing, whereas ほかに sounds a little more casual.
these is no other way besides this one
these is no other way apart from this one
ほかに is used in situations where you'd ask someone if they want something else from the store, whereas ほかは is used in more serious scenarios, like when you want to say that there's no other way to do something.
However, the difference is very subtle and both can be used in either situation.
The sentence "ビールのほかは何もいりません。" puts more focuses on the other things than "彼女のほかに知り合いはいません。" does.
If the second sentence was used in an argument with a girlfriend, I'd also use ほかは rather than ほかに like so:
When looking at the translation DeepL gives for either sentence, the grammatical difference becomes quite clear I think:
I don't know anyone else besides her.
Other than her, I don't know anyone else.