The Conditions of Lying in Fiction
As long as you do not make claim of function being non fiction then you are OK.
For something to be a lie the following conditions must be fulfilled.

i) The statement must be untrue.
ii) There must be an intention to deceive.
iii) An effort must be made to deceive.
iv) The other person must know the meaning of what is expressed.

Souce: FIVE PRECEPTS (PACASILA) at https://www.urbandharma.org
In writing non fiction, you would not be having the second condition as you would know and also making know this is fiction.