Resuming on 193-7, still needing 65 to make the visitors bat again, Leach (90) and Barnard (42) put on 100 to help Worcestershire post 349.
Leach then claimed two wickets to leave the Foxes wobbling on 43-2.
But Paul Horton (75*) and Mark Cosgrove (58*) saw Leicestershire to the close on 172-2, a healthy lead of 230.
In company with fellow former Shropshire all-rounder Barnard, Leach fell just 10 runs short of his first century for three years.
Despite Leicestershire all-rounder Clint McKay taking a tidy 4-59 from 24.1 overs, it left Worcestershire only 58 in arrears on first innings.
Leach then broke through in each of his opening two overs as Angus Robson slashed a delivery to point before first-innings centurion Neil Dexter was brilliantly stumped by Ben Cox.
But captain Cosgrove and former Lancashire skipper Horton got on top to leave the visitors, who started the game 13 points ahead of the home side in fourth, pushing for a third Championship win of the campaign.
Worcestershire all-rounder Joe Leach told BBC Hereford & Worcester:
"It has been pretty good old-fashioned attritional cricket throughout the day. The pitch dictates that to a certain extent. It is not the quickest and with not much going on for the seam bowlers or the spinners.
"We were up against it after the poor session we had on Monday evening so, to stay in the game, it was imperative that we had a good morning with the bat and got as close as we could to them.
"It is mine and Ed Barnard's natural game to try and get on with it and, in the end, we can be satisfied with finishing 50-odd behind on first innings from the position we got ourselves into."
Leicestershire all-rounder Clint McKay told BBC Radio Leicester:
"It didn't go probably as well as we hoped this morning but that's cricket and they batted very well and we probably weren't at our best with the ball. The game drifted away from us quite a bit.
"But we bounced back after lunch, got a couple of quick wickets and batted quite nicely in the final session to set ourselves up for going into day four.
"With my four wickets, there were a couple of lucky ones in there but it is a hard slog. You get wickets like that now and then.  It is all about running in and making it as hard as we can for the batters."
Leicestershire have the upper hand at New Road, despite Worcestershire being spared a possible innings defeat by Joe Leach and Ed Barnard's century stand.