Main fired into the bottom corner after good work from Jonathan Forte to seal a crucial three points which guides Latics away from danger.
The win also extended the club’s unbeaten run to four games, and sealed the fourth clean sheet in a row with a game in hand on teams around them.
Manager John Sheridan named an unchanged line up from Tuesday night’s victory over Swindon Town with Main and Forte leading the line.
It was a quiet opening to the game with neither side taking a grip of proceedings but the pair linked on nine minutes but Neil Etheridge was out to collect the loose ball.
Walsall had the first sight of goal on 15 minutes but Anthony Forde’s free kick from 30 yards rebounded off the wall and away to safety.
Goalkeeper Joel Coleman had to be alert a minute later as Jordy Hiwula raced through on goal but he stood tall to deny the striker.
Seconds later, he again had to race out, this time to deny striker Tom Bradshaw in the penalty area.
Forde again tried his luck from distance for the Saddlers but midway through the half, Latics almost took the lead.
Tareiq Holmes-Dennis took the ball to the byline, cut it back to Curtis Main who volleyed inches wide of the post.
Romaine Sawyers was a constant threat in the midfield for Walsall and he was tripped on the edge of the box before the half hour mark.
This time it would be Andrew Taylor who struck and it fell inches over Coleman’s crossbar.
The goalkeeper was being put under a lot of pressure in the first half, and he denied Sam Mantom with a superb one-handed save to keep the scores level.
After James Wilson received treatment for a head injury, Latics started to up the tempo and went the closest before the break.
Matt Palmer’s free kick was saved well by former goalkeeper Etheridge before Jonathan Forte maybe should have given Latics the lead before the break.
He nicked the ball off Matthew Pennington, took the ball around Etheridge but hit the side netting after being forced wide.
Latics started the second half strongly, looking far more comfortably in possession.
Chances were limited in the opening 10 minutes of the half as Wilson headed just past the post, whilst at the other end Jason Demetriou tried his luck but struck over the bar.
Just after the hour mark, Latics took the lead through Main.
It was persistent work from Forte which forced the goal as he chased down a loose ball, pulled the ball back for the Doncaster Rovers loanee and he found the bottom corner from inside the penalty area.
Latics did not settle on that lead and went in search of another with Forte and Jones both shooting inches wide from distance.
There was an air around the ground that supporters were nervous, but they did their best to get behind the lads, singing, chanting and cheering every ball.
Walsall were piling on the pressure but they were met by a resolute Oldham Athletic defence, with Coleman in inspired form.
With only 10 minutes remaining, the Saddlers had their best chance of the game through Jordy Hiwula.
The striker found acres of space on the edge of the box but thrashed his effort way over the crossbar when he had a little bit more time than he thought.
Sheridan made a change in the final five minutes as Jake Cassidy replaced Forte, who received a standing ovation for his work.
The striker put himself around in the final minutes but it was all hands on deck for Latics as Walsall continued their dominance in possession.
As four minutes of additional time was announced by the fourth official, Wilson flung himself in front of a shot from Jordan Cook which cleared the ball away from danger.
Latics held onto the ball in the late stages of the game and did enough to come away with a vital three points.
Oldham Athletic: Coleman, Dummigan, Gerrard, J.Wilson, Holmes-Dennis, Dieng, Kelly, Palmer, Jones, Forte (Cassidy 83’), Main.
Subs not used: Cornell, Brown, Mills, Croft, Winchester, B.Wilson.
Walsall: Etheridge, Demetriou, Taylor, Pennington, Downing , Chambers, Mantom (Morris 84’), Bradshaw (Cook 72’), Sawyers, Forde (Lalkovic 66’), Hiwula.
Subs not used: MacGillivray, Henry, Preston, Kinsella.
Goals: Oldham Athletic (Main 63’) 1-0 Walsall
Attendance: 4,396 (565 visiting supporters)