With the score tied, Willingham thought he was going to face Alfredo Simon, but the O's closer strained his left hamstring on a close play at first base. Simon left the game and was replaced by Cla Meredith, who gave up the home run to Willingham on a 2-1 pitch.
It was Willingham's eighth home run of the season.
"When you get a game-winning hit like that, it's why you play the game as a baseball player," Willingham said. "You play the game to be in that situation and come through. I wasn't trying to hit a home run, just trying to hit it hard. It got up in the air and went out."
The Nationals are a game over .500 at 23-22.
After a month without registering a win, questions loomed over whether Washington left-hander John Lannan was healthy or needed to fix his elbow. He answered those critics by going 5 1/3 innings, allowing one run on two hits, both coming in the first inning.
Corey Patterson scored that run on a double-play groundout by Miguel Tejada.
"I've had a couple rough starts there because of my arm, but I'm feeling healthy, which is the main thing," Lannan said. "I'm making good pitches when I need to and getting a lot of ground balls. It's been the key to my success the last couple of years, and I just need to keep on going out there, take care of my arm and learn from each start."
The initial runs for Washington came in the bottom of the first. With the bases loaded, Roger Bernadina took a Kevin Millwood pitch and hit it deep in center field. It looked like center fielder Adam Jones may have had a bead on it, but the ball went off his glove for a triple, scoring Nyjer Morgan, Ryan Zimmerman and Willingham.
"I mean there's no elaboration, I just didn't come with it," Jones said. "You either catch it or you don't. I didn't. You are supposed to make that play. Just like [Morgan] was supposed to catch that ball [Saturday], I was supposed to catch this one today. It happens."
Nats manager Jim Riggleman praised Bernadina and indicated that he is close to winning the job in right field.
"He's just getting a little better each time," Riggleman said. "He's really finding his way and getting a little more comfortable."
Reliever Drew Storen entered for Lannan in the sixth with one out. With Patterson on second base, Storen got Miguel Tejada to ground out. After walking Ty Wigginton, Storen struck out Luke Scott for the final out of the inning.
Storen also collected his first career hit, a single to left field in the bottom of the sixth. He had not stepped into the batter's box in a game since high school. He also added that because his head is so small, that he used the bat boy's double-flapped helmet.
"I just went up there and tried to make contact," Storen said. "Especially facing a guy like Millwood, you just want to put it in play."
Relievers Sean Burnett and Tyler Clippard combined to pitch a scoreless eighth.
But closer Matt Capps, who had not blown a save this season, made the game interesting in the top of the ninth.
With runners on second and third and one out, Scott scored on a groundout by Matt Wieters. Julio Lugo followed and singled to right-center field to drive in Jones to even the game at 3.
Capps said he was glad his teammates could bail him out.
"Obviously, I want to do well every time I go out there, but for [Willingham] and the guys to pick me up like that and have us not lose the ballgame, I definitely feel better about it," Capps said. "Nonetheless, when it's all said and done, my job is to seal the deal, and I didn't do it."
After a day off Monday, Washington plays 10 consecutive games in San Francisco, San Diego and Houston before returning home on June 4 to face Cincinnati.
Willingham said Sunday's win gives a lot of momentum heading into a challenging road trip.
"We just have to keep playing hard," Willingham said. "This game is an emotional win for us and hopefully we can carry it on and have a good road trip."