It is grammatical, but there is a combination of two different processes going on here, both rather literary.
The first is topicalization, by which a phrase is brought to the front of the sentence to give it prominence, or to link more clearly to what has come before - here With these.
That process does not usually cause the subject and verb to invert: see the examples in the Wikipedia article I linked to.
But here a second process has occurred, that of extraposition. Because the subject is long (the question of when to begin counting) and the verb only a single word, this rule allows them to be inverted.
So the pattern is
The question of when to begin counting, however, arose with these.
With these, however, the question of when to begin counting arose.
With these, however, arose the question of when to begin counting.
"However" comes second, whichever sentence structure is used. Not the second word, but the second constituent.
There are some expressions, all with a negative polarity, which can come first and always trigger inversion: phrases such as never, in no way, and in few places. This is not an example of that construction.
Extraposition usually swaps the verb or auxiliary with a long phrase that qualifies the subject, leaving the simple subject in place:
With these, however, the question arose of when to begin counting.
Both forms are possible here: this one leaves the simple subject (the question) in place; but because of the topicalized phrase, your original form is also possible, as it does not leave the verb standing first.