Nadir Ciftci's first-half double put McNamara's team in the driving seat before Ryan Gauld's and substitute Chris Erskine broke through in the second half.
He said: "It was a nice belated birthday present. It comes at the end of a good week.
"I thought we were excellent from the first whistle to be honest.
"If anything it could have been more when you see the chances we created.
"All-round we just clicked and it was all to do with hard work.
"Gary Mackay-Steven was brought back in and caused them lots of problems as his attitude was great.
"When we play like that we are good to watch and can compete with anyone.
"That's always how we like to try and play and that's how it will stay.
"We've got a big game up in Inverness now on Tuesday in the League Cup and this is a good boost.
"It will give the players confidence."