I have 2 different tickets where I would be flying into Munich Airport Terminal 2 at 7:55am on Singapore Airlines and transiting to a 12:45pm Lufthansa flight to Rome. I would like to know if there is a way for me to check in my luggage after collecting them within the secured area. Or do I need to go out of the secured area and check in the luggage separately.
This comes down to whether Singapore Airlines is able to check your bags through despite the two separate tickets. They are not required to do so under Star Alliance rules, but they're generally known to be on the more generous side, compared to some airlines that will absolutely refuse to do it. Make sure you have all the ticket information for your Lufthansa flight, present it to the Singapore agent at check-in, and ask nicely if your bags can be checked through. If the agent is unsure how to do it, perhaps ask if there is someone else who can help.
If they cannot check your bags through, you'll have to go through immigration in Munich, pick them up in baggage claim, take them through customs, check them in at the counter, then go through airport security. This shouldn't be a huge problem though, as you have a fair amount of time if your flight is not significantly delayed. For this itinerary, you'll have to go through Schengen immigration and airport security in Munich whether you need to recheck bags or not, so these are largely steps you'd be doing anyway, just not in the transit area; the only additional steps are the stop at baggage claim and the ticket counter, plus the walks in between.
I would like to know if there is a way for me to check in my luggage after collecting them within the secured area. Or do I need to go out of the secured area and check in the luggage separately?
If you have to recheck your bags, there's no way to avoid leaving the secure area of the airport. You have to go through customs, recheck your bag, and then go through security to get to the gate. Here's an image of the Terminal 2 baggage claim area, taken from the interactive map on the airport's website, showing that all roads lead through customs:
To be precise: Luggage pickup is already outside the secured area, so if you have to recheck your luggage, you have to leave the secured area before you collect it.
Even if your luggage can be checked through, I would consider leaving the secured area if you have almost 5 hours in transit. At Munich airport, everything (eateries, shops) within the secured area is very expensive. Outside the secured area, there are also many shops, even grocery stores and a baker and several places to eat, with a more or less normal price level.
In terminal 2, Lufthansa has self-service check-in and bag drop kiosks, usually with no waiting time at all. Security check is also usually very swift, with rarely more than 5-10 minutes waiting time. Walking distances are also unusually short. When you come out of the luggage pickup area, you are on the floor immediately below the check-in area. Take the escalator one floor up and there are just a few minutes walk past to the check-in kiosks and security, before you are back in the secure departure area.