When Jacqueline Elbaz laced up to train for her first marathon, she assumed amping up her running routine would help her shed pounds.

But when Elbaz, who works in fashion, crossed the finish line at the 2014 New York City Marathon, she was 15 pounds heavier than when she’d started training four months prior.

After spending the weeks leading up to the race lounging in yoga pants, exhausted by her grueling regimen, she felt the extent of her weight gain once she pulled her regular clothes back on post-run.

“I realized I was gaining weight during training, and then at the end I realized, ‘Wow, it’s bad,’ ” says the 25-year-old Midtown resident.

First-time marathoners often assume the pounds will melt away when they hit the pavement. But for many novice runners such as Elbaz, training for those 26.2 miles has the opposite effect.

“Every season, there are people who gain weight through the process,” says New York City race coach and nutrition counselor Daphnie Yang.

‘People are overestimating how many calories they’re burning over the run, and as a result they’re consuming too much.’ - Race coach and nutrition counselor Daphnie Yang

She chalks it up to a few different causes. The most common is overeating, as hard as that may seem to ravenous runners. She says racers often fill up on a big meal at the end of the day to replace the calories they think their bodies burned during long training runs.

“People are overestimating how many calories they’re burning over the run, and as a result they’re consuming too much,” Yang says. It’s a mistake any exerciser can make, whether they’re training for a marathon or getting back to the gym after a hiatus.

That’s what happened to Diana Johnson Galante, who completed 10 marathons, including the NYC Marathon, while in grad school. The 35-year-old art conservator, who now lives in Baltimore, assumed running for hours a day would help fight the weight she’d gained thanks to stress-fueled bingeing sessions and overeating before and after runs.

“Over three years, I gained 30 pounds,” she says. “I mostly ate healthy food, just too much of it . . . It was really embarrassing to be in a running club and gaining weight — they ordered an extra-large jersey for me,” she adds.

“I knew it was happening, and I knew I wasn’t doing something right, but I just couldn’t stop eating.”

She quit marathons after finishing grad school in 2009, and slimmed down to her regular weight within a year, thanks to a combination of less stress and no more post-run hunger pangs.

Becki Ledford, based in Charlestown, Mass., experienced similar weight gain. “I’ve run three marathons, and during each of those training cycles, I noticed weight gain,” says the 29-year-old, who works in health care.

Ledford had previously lost weight running, and said she was surprised to find that extra miles meant extra pounds. She now chalks it up to becoming a more efficient runner, meaning her body had to make less of an effort when running — therefore burning fewer calories. “If you’re used to your mile burning 100 calories, and then it burns 90, you’ll run into problems,” she says.

The sports drinks she was swigging didn’t help, either. “I was definitely eating more carbs than before, thanks to gels, chews and Gatorade,” she says. “I think people forget to take that into account — it all adds up.”

But sometimes, eating too little can also help pack on the pounds. Elbaz attributes her double-digit weight gain to consuming too few calories, which can cause your metabolism to drop. “She became inefficient at burning calories,” says dietitian Heidi Skolnik, meaning Elbaz’s body stored excess calories as fat, rather than using them as energy.

“I was starving after my runs, but I would tell myself, ‘You can’t eat any more, you’ll put on weight,’ ” says Elbaz. “So I ate less, and I still put on weight.”

It wasn’t until a coach on her running team, Gotham City Runners, pointed out that she wasn’t fueling properly that she realized the mistakes she’d made. Now, she doesn’t binge, but rather listens to her body and eats when she needs to refuel.

“Now [training for my upcoming marathon], I’m probably eating triple the amount that I ate last time, and I’m losing weight,” Elbaz says. “I used to count calories all the time. I used to be one of those girls. Now I eat when I’m hungry — I probably eat close to 3,000 calories [a day].”

In the two years since her first marathon, she’s learned how to keep her body going through 15- or 20-mile training runs. “I’ve learned to eat protein within 30 minutes of doing hard workouts,” she says. “And I used to not fuel on long runs, or bring superhealthy things [such as dates] — now I’m not afraid to have gels or other snacks.”

For other runners, extra pounds that show up during training could be due to water weight — and while it won’t last, it can make you look bloated as you cross the finish line.

That’s what happened to Dail St. Claire, a 57-year-old Midtown resident who took up running at 51.

“In the beginning, when I started running, I was drinking an average of two glasses of water per day,” says St. Claire, who works in private equity. “I was starting out running dehydrated. It was gross, I was so puffy.”

Yang says that’s not uncommon for runners who don’t drink enough H2O. “The human body is going to retain water if it feels like it’s not getting enough,” she says. She recommends hydrating every five miles and downing at least two cups of water at the end of a workout or run.

Still, says running coach Gary Berard, gaining weight while training isn’t always a bad sign — especially if it comes while tapering before the marathon.

“As you approach the race, most people initiate a three-week taper period, wherein you pull back your mileage so you don’t enter the race fatigued,” he says. “You pull back on exercise, but continue that steady caloric intake — if you add a few pounds, you’re probably doing things right.”

Avoid marathon weight gain

Eating right while training is a delicate balance. Here, expert Daphnie Yang breaks it down.

Fuel up before you work out

“[My running group] would meet at 8:30 a.m., and it was always the people who didn’t have breakfast who struggled the most,” Yang says. She suggests a banana or toast with peanut butter before a training run.

Recharge within an hour

“You’re burning through a lot of carbs, and your body needs to replenish,” Yang says. She suggests eating a carb- and protein-rich snack, such as a health bar, or a meal 45 minutes to an hour after your run.

Avoid bingeing at night

“Having your biggest meal at night is not the way to go, because you won’t be utilizing that fuel. Save your calories for when you’re moving,” Yang says.

Cool it on the runner candy

“[First-time] runners get excited about the chomps and the chews and the gels — they’re so shiny and cool,” Yang says. While she recommends one piece of “runner candy” every six miles, it’s easy to overdo it on the sugar-heavy boosters. Yang also suggests ditching Gatorade and other sugary drinks for water.