how verbal is she? Could you have a little talk about it and see whether she can tell you what the matter is?

Has anything else changed? Is she under unusual stress for any reason? Is she having any jealousy / regression issues wrt her baby brother?

How did you handle the accidents? Is it possible that the first time was due to the uti but then she decided that wetting gets more attention than toiletting?

Just a few things to consider...