As far as I have seen in the examples, inversion comes to emphasize something. In doing that such words like never, only, and ... are used.
Now is it correct to say:
"Mainly by the imagination does a discovery take place."
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.Sign up to join this community
I see nothing wrong with this. The result is exactly as you suggest, emphasizing "imagination" over "discovery".
I would suggest replacing "by the imagination" with either of the following: