Defoe scored to give David Platt's side a 2-1 lead after the visitors had equalised Shola Ameobi's opener for England.
The Hammers striker finished cooly, waiting for the keeper to commit himself before rounding him and slipping the ball into an empty net.
Serbia and Montenegro fought back, however, to level matters for a second time before substitute Darren Bent scored with two minutes left to give England's Under-21 side a 3-2 victory.