Rankin, 59, made the admission while being interviewed by the SNP politician about his books, at the Bloody Scotland crime writing festival in Stirling.
The topic of Rebus' politics was raised during a Q&A session with audience members at the city's Albert Halls venue.
A woman in the balcony, said: "I was just wanting to ask Ian; Rebus.. aye or no?"
Rankin replied: "I think I might have answered this in one of the books, I can't remember -- he's only voted three times in his life, for three different parties."
However, when Miss Sturgeon challenged the author, saying "that's a politician's answer", he returned to the questioner.
He said: "I think Rebus, if you're talking about yes or no to independence, which I assume you are, and not Brexit, the thing about Rebus is Rebus likes the status quo.
"He fears change, he doesn't like change, and is very set in his ways. I think he would be a 'no'."
Rankin, whose answer brought gasps from some audience members, added: "But in balance, (Detective Sergeant) Siobhan Clarke would be a 'yes' and (Inspector) Malcolm Fox would be right down the middle, weighing them all up, waiting to decide how's it all going to go."
Miss Sturgeon, a voracious reader of Tartan Noir crime fiction and fan of the Rebus novels, said: "I think Rebus would have voted yes in the independence referendum and leave in the Brexit."
Rankin added: "Oh my God, I can't think of Rebus as a Brexiteer. But do you know what, he's never had a passport so you might be right."
Rankin praised the First Minister for her passion for books, however.
"I think it's just great that we've got somebody in charge in Scotland who does like to read, who's passionate about books.
"We need the next generation. We need parents to read to their kids and we need kids to know there are books for them to read and that reading's not an embarrassing thing to do. It's great that you do that."
Rankin told the audience how the first draft of his 1987 debut Rebus novel, Knots and Crosses, ended with the cop shot dead.
Rebus has since become one of Scotland's most famous fictional characters, featuring in 22 novels in the series.