Catalysis of the reaction: UDP-N-acetylmuramoyl-L-alanyl-D-glutamyl-L-lysine + ATP + D-alanyl-D-alanine = phosphate + UDP-N-acetylmuramoyl-L-alanyl-D-glutamyl-L-lysyl-D-alanyl-D-alanine + ADP.
UDP-MurNAc-L-Ala-D-Glu-L-Lys:D-Ala-D-Ala ligase activity