The left-hander used that experience to his advantage on Wednesday night.
The Cardinals, who are 18-9 since the All-Star break, captured their sixth successive series after taking the first three of the four-game set.
Gomber gave up three hits, struck out six and walked four. He wriggled out of a pair of jams while nursing a 1-0 lead.
"I think being in the bullpen kind of helped me in these situations," Gomber said. "Even when the bases get loaded, I never feel any panic. It's just something that you've got to become more comfortable with."
Gomber ended his 99-pitch outing by striking out three successive batters after giving up a leadoff double to Bryce Harper in the sixth.
"This guy gets after it," St. Louis interim manager Mike Shildt said. "He's not going to back down from anyone."
Gomber (3-0) struck out Michael A. Taylor looking with the bases loaded to end the fourth. He retired Anthony Rendon on a flyball with runners on first and third in the fifth.
Daniel Murphy homered in the ninth for Washington, which has lost four in a row and seven of nine to fall below .500 and nine games behind the first-place Atlanta Braves in the NL East. The current skid began with a loss to the Cubs on a two-out, walk-off grand slam.
"When you're in a playoff race, we've got to score first, we've got to score early," Nationals manager Dave Martinez said. "We can't squander the opportunities that we get and we've been doing that."
Ozuna homered in the second inning, his 14th of the season and his first since July 30, covering 62 plate appearances.
Bud Norris pitched the ninth to pick up his 23rd save in 27 opportunities,
St. Louis infielder Matt Carpenter extended his on-base streak to 33 games with a walk in the fifth. It's the longest current streak in the majors. Carpenter left the game in the seventh after he was hit on the hand by a pitch from Matt Grace, but X-rays were negative.
Carpenter does not expect to miss any time.
"The pain and swelling started to go down a bit," Carpenter said. "I definitely dodged a bullet there."
Washington starter Jeremy Hellickson (5-3) left in the fifth inning after he fell on his wrist on a play at the plate following a wild pitch. Hellickson gave up three runs, two earned, on three hits in 4 1/3 innings. He struck out two and walked two.
Hellickson realizes the Nationals' chances of making the postseason are dwindling.
"We're going to need a lot of help, that's for sure," Hellickson said. "We've made it pretty tough on ourselves here."
Bader, who had three hits, also made a diving catch of a liner off the bat of Harper in the fourth. Bader scampered home on a wild pitch in the fifth inning for a 2-0 lead.
"We've known all year that we're capable of playing this type of baseball," Bader said. "It's nice to see it come out in between the white lines. Everything's rolling together and we're just going to try and preserve it the best we can."
The Cardinals, who have an NL-best 12-2 mark in August, remain one game behind Philadelphia for the second wild-card spot. They are four games behind Chicago in the NL Central.
Nationals: RHP Stephen Strasburg (pinched nerve in neck) threw a simulated game on Wednesday. He threw around 70 pitches and could be ready to return from the disabled list early next week, manager Dave Martinez said.
Cardinals: LHP Brett Cecil was activated from the DL on Wednesday. Cecil, who had been sidelined with inflammation in his right foot, pitched four scoreless innings in four appearances with Triple-A Memphis. LHP Tyler Webb was optioned to Memphis.
RHP Tanner Roark (7-12, 4.12) will face RHP Luke Weaver (6-10, 4.66) in the finale of the four-game series on Thursday. Roark has won his last four decisions. Weaver is 1-4 with a 5.13 ERA in nine career games against NL East foes.
More AP baseball: https://apnews.com/tag/MLBbaseball and https://twitter.com/AP-Sports
Which players should teams target in trades this winter?
For teams looking to make a high-impact addition, a winter swap could land some MVP-caliber performers.
Predicting 2019 for this year's MLB awards finalists
After the hardware is handed out this week, here's what comes next for baseball's best players.
Taking a look at the AL Rookie of the Year finalists
Gleyber Torres and Miguel Andujar put up strong numbers in 2018, but despite being limited because of an injury, Shohei Ohtani managed to impress while on the mound and at the plate.
MLB awards roundtable: Who will take home the hardware and why
Ohtani or Andujar? Verlander or Snell? DeGrom with just 10 wins?? We break down all the angles in advance of baseball's major award announcements.
MLB All-Stars pick up first win over Japan
Yadier Molina and J.T. Realmuto both homered Sunday to lead the MLB All-Stars to a 7-3 win over Japan for their first win of the six-game exhibition series.
NL Central offseason preview: Can the Brewers do it again?
Milwaukee seems due for some regression, the Cubs don't figure to throw money at their problems and the Cardinals might be looking to add some star power.