Security staff at the hospital found him and he was resuscitated by medical staff. Police said he was “now doing well”.
A 31-year-old man has been arrested on suspicion of attempted murder. Police have appealed for witnesses.
Det Insp Martin Reddington thanked the hospital staff whose “heroic actions saved the life of this newborn baby.”
He said: “This is an awful situation, I am just so happy I am able to say that the baby boy is doing well.
“We have made an arrest and we will be thoroughly investigating how this happened.”
He appealed for anyone who was in the accident and emergency ward between 19:00 BST on Tuesday and midnight and saw a man and a woman in or around the toilets to contact them.
Andrew Foster chief executive of Wrightington, Wigan and Leigh NHS Foundation Trust said: “I would like to thank all staff who were involved for their professionalism and calmness during the incident, particularly the diligent member of staff who discovered the baby and raised the alarm.
“I’m very proud of the way our staff worked, their quick response without doubt saved the baby’s life.”
The accident and emergency department was closed overnight but is now open as usual, said police.