Try www.itd.nps.gov
That website will give the National Poark Service's Soldiers & Sailors System.
You can search for 4th Minn. Infantry then link to a roster of entire regiment--2000 plus names.
The "good news" is the soldier's company.
The "bad news" is you will have to wade through the enitre list to find Co. B soldiers