Aramis expresses similar ideas in Twenty Years After, "My first opinion had been entirely for the cardinal: I told myself that a minister (of state) is never loved, but with the genius that one accords to this one, he would finish by triumphing over his enemies and by making himself feared, which, in my opinion, is better maybe than making himself loved." Dumas finds this to be a "doubtful maxim."
Machiavelli lived from 1469-1527. Twenty Years After takes place in 1648 but was written by Dumas in the 1800s.
Translation of the quote from Vingt Ans Après (Twenty Years After) is a mix of my own and the version of the book on The Literature Network. The Literature Network: Twenty Years After