Yes.. Both emit tannins which will help bring down pH. Malaysian and African mopane driftwood are also good because they sink naturally on their own.
BUT .. they "wear out" eventually, and then your pH goes back up. If it'sa big piece, it should last for years.
Some truism's on pH and water chemistry:
1. A stable pH and water chemistry is better than the "right" one.
2. 95% of all fish can adapt to 95% of all available tap water.
3. Guaranteed, your LFS is keeping them in tap water.
4. Chances for success and life is easier if you keep species of fish which like your local tap. Your costs are less, and it is easier and therefore more likely that you will keep up with water changes.