So, for example, if there were a bunch of pencils on a table and someone asked me which was mine, I'd say
これ が 私 の です, emphasizing that THIS is my pencil
and if there were only one pencil and someone asked whose it is, I'd say
これ は 私 の です, emphasizing that This is MY pencil
Also, when you say it works most of the time, you mean except when が or は are used for explicit stuff (i.e.contrast, certain verbs, etc)?