But Dagenham should have had the points in the bag moments earlier had skipper Mark Arber not missed from the penalty spot.
Northampton made the most of the let-off and McKay backed their first victory in the league since October.
In a dreadful first half neither side managed a shot until late on when Ryan Gilligan forced Tony Roberts to tip over his 25-yarder.
Chris Dunn then denied Miller at the near post in the 79th minute but when Seth Ofori’Twumasi returned the ball back into the box Andy Holt handled to gift the visitors a penalty. But Arber blazed the ensuing spot kick over the bar.
And Dagenham were made to pay in the 88th minute when a scramble in the box ended with McKay shooting on the turn, Roberts parried his shot but could not stop it from crossing the line.