Martinez came through to take the 164.1km stage to Estaires in a time of 3:41.28 from Matthias Friedemann of Germany and compatriot Benoit Drujon.
But it was Demare, also of France, who gave his FDJ team the overall victory in the Tour du Nord-pas-de-Calais after finishing 17th in the final stage.
Demare, who narrowly missed out on a fourth straight stage victory on day four, was the comprehensive winner of the race with Florian Vachon of France fully 16 seconds back in second place.
Ramon Sinkeldam of the Netherlands finished a further 10 seconds back to take third place in the general classification.
- Sports & Recreation