Harry Potter and the Order of the Phoenix
Richard Harris died on the 25th of October, 2002. The role of Dumbledore was recast for the third film, Harry Potter and the Prisoner of Azkaban, for which principal photography started on 24 February 2003. The film was released in the end of May 2004 in the UK.
The fifth book of the series, Harry Potter and the Order of the Phoenix, saw its worldwide release on 20 June 2003.
This means that the book must have been almost if not completely finished by the time filming started. If the book-character of Dumbledore was influenced by Gambon's portrayal, it must have happened for the books after the fifth.
Harry Potter and the Half-Blood Prince and Harry Potter and the Deathly Hallows
The sixth book in the series, Harry Potter and the Half-Blood Prince was released on 16 July 2005. About two months before, the fourth film, Harry Potter and the Goblet of Fire had been released. So the only portrayal of Dumbledore that could have influenced this book, was the third film.
As we all know,
Dumbledore dies at the end of the sixth book.
His appearance in the seventh book, Harry Potter and the Deathly Hallows, is pretty limited because of this.
The only books that could have been influenced by Michael Gambon's portrayel of Dumbledore, are the sixth and the seventh, Harry Potter and the Half-Blood Prince and Harry Potter and the Deathly Hallows. Dumbledore's part in the seventh book is pretty small.
There is only one film with Michael Gambon as Dumbledore that could have influenced Harry Potter and the Half-Blood Prince.
Therefore, it's pretty unlikely that Michael Gambon's portrayal of Dumbledore influenced JKR's writing.