The former Manchester City and West Ham midfielder, 39, has spent two seasons at the Scottish Premier League club.
Millwall chairman John Berylson said: "Steve has great passion and energy, knows a lot about Millwall as a club already, and this is a job he is genuinely hungry for.
"We want the best man for the job, and we believe that man is Steve Lomas."
Millwall have agreed terms with Lomas and St Johnstone, and he will start work when he returns from holiday next week.
The former Northern Ireland international joined St Johnstone in November 2011 after a spell as manager of non-league outfit St Neots Town and time as reserve team manager at West Ham.
Lomas led the Perth club to consecutive top-six finishes in the SPL, securing a place in the Europa League qualifying round on each occasion.
Championship side Millwall have been without a manager since Kenny Jackett resigned at the end of last season after five and a half years in charge.
Jackett has since been appointed head coach of Wolves.