Dundalk bounced back from their defeat last week to maintain their spot in third place with a 2-1 win away at Finn Harps.