Determine if node is new
Pathauto reacts on node save, which doesn't happen when you insert directly via SQL. Pass data from your external application to a custom hook_menu entry, assemble the node from $_GET-data, and run node_save($node), instead of inserting it directly.

Second option, if to enable Services, which allows you to pass data in as json, and have the nodes created that way.

I belive both ways will properly trigger Core hooks, so that pathauto will be called.