An organization founded to tackle one shortage area in computer science education is teaming up with the teachers union to address another.

Girls Who Code, whose founder Reshma Saujani is running for citywide office this year, launched last year to address stark gender inequities that exist in computer science, one of the many job markets in the field of Science, Technology, Engineering and Mathematics (STEM) where women are underrepresented. The organization’s eight-week curriculum began last summer with 20 girls and will expand to 160 this summer, with new programs in Detroit and San Francisco as well.

The organization will also be lending its curriculum out to help train a small group of 20 teachers, the United Federation of Teachers announced this week. The union is trying to keep pace with the evolving demands in career and technical education and union chief Michael Mulgrew said one challenge is retaining young math and science teachers, who leave “because we don’t give them something engaging to do.”

“We’re going to make the difference by doing it where it really counts, which is training the teachers so they can bring it inside of the classroom because that’s where the students are,” Mulgrew said this week at an event announcing the pilot, called “Teachers Who Code”.

The pilot, a one-week training course hosted by the technology company AppNexus, is the latest effort underway to prepare students for job openings in the STEM field. In New York State alone, nearly 500,000 STEM-related jobs are projected to be created by 2018, the bulk of which are in computer science,  according to a report published last year.

Separately, the city is also training 40 teachers in 20 schools that next fall will launch career and technical education programs with software engineering tracks. The programs include classes in coding, fashion design, and mobile applications, and are designed to award graduating students with state-accredited diplomas that certify they can work in the expanding technology job market.

One goal of the program, officials said, was to double the number of underrepresented students who take Advanced Placement computer science exams. Just 30 percent of the 452 students who took last year’s exam were girls, who normally make up nearly 60 percent of all A.P. test-takers.

Mulgrew appeared at the event with Saujani, who also happens to be running for public advocate, a closely-contested race that the union has yet to endorse in. But union officials went out of their way to note that the appearance with Saujani was not a sign of which way they’re leaning.

“This is not an endorsement,” Mulgrew said jokingly — and unprompted.

Still, Mulgrew had glowing things to say about the work Saujani has done with Girls Who Code, which relies heavily on partnerships with large companies like Facebook, Google, Twitter, Goldman Sachs and IBM.

“A lot of people come into this building with ideas and it’s really about getting the press release,” Mulgrew said, referring to the steady stream of elected officials who seek the union’s support for their education proposals.

Saujani, who first approached the UFT two years ago about training teachers, was different, Mulgrew said.

“I’m so happy that we get to stand here today and say you kept your word,” Mulgrew said. “It’s been everything you said you’d do and we’re so happy that we are partnered with you and your team on this.”

Saujani said she had a shared interest in helping out the union. Early on, she said, she realized that Girls Who Code would not be successful “unless we have more teachers” to do the job.

“You can’t solve the pipeline problem without the teachers union,” Saujani added.