Alba had just given birth to her third child and was still breastfeeding her son when she started shooting the "Bad Boys" spin-off series, and Union became a mum last year (18), via a surrogate.
The "Sin City" star, who oversees lifestyle brand The Honest Company, decided the TV set was too cold and stark and needed a little 'mothering' up.
"I think it's important we set the stage that this is a family-friendly environment and a feminist environment," said the mother of three, who turned her trailer into a nursery and then did the same for Union's ahead of the birth of her baby daughter, Kaavia James Union Wade, in November.
Alba also helped her co-star get mentally prepared for motherhood after realising she was clueless.
"I was never that person who babysat," Union told TV Guide. "I'd mow your lawn before I'd babysit. When I left for the hospital I had nothing. I had my wig!"
Alba also advised Gabrielle about baby products and gave her trailer a baby-proof makeover.
"In a trailer, you only have so much space," she explained. "I took out the table they have and put in a pack-and-play where the baby can sleep. It also has a changing table."
She also made sure there were no sharp edges and removed potentially dangerous items.
The first trailer for the new show, in which Union reprises her "Bad Boys 2" character Syd Burnett, debuted on Thursday, February 07. She and Alba play cop partners on the mean streets of Los Angeles in the TV series, which hits screens in May.