In addition to JcieL's explanation about the usage of "ng" as a preposition / prepositional phrase, "ng" can also be used as an article such as:
"kumuha ka NG isa'ng baso na tubig." ('get A glass of water.')
note: the word "isa'ng (one)" here is a quantifier of the noun "baso (glass)". the article "ng" in Tagalog always goes before the quantifier (but not in English).
"ama NG anak." ('father of THE son.')
as for "ng" to be equaled to the preposition "with" in english language, you can say:
"ipagpalit NG manika." ('exchange WITH doll")
:)